Small script request (shrotcut target different depending on time of day)

Soldato
Joined
2 Jun 2004
Posts
18,423
Hey guys.

I was wondering if anyone who knew programming could write me a small script (Win7+Win10)?

Basically I have two near-identical folders each with an exe. And I want one shortcut on my desktop which, when clicked, will check the time of day, and if it's 8am-8pm it will launch the exe from folder "A", and if the time is outside of those hours it will launch the exe from folder "B".

Hopefully that's pretty simple (I honestly have no idea, please just ignore the request if it's a lot to ask!).

Cheers.
 
Last edited:
Ok my bad. Heh *facedesk*. It works fine. ;)

Although... having said that, I'm still having trouble with the paths. I use double backslashes as mentioned, but get the following error;

Code:
Line: 7
Char: 4
Error: The system cannot find the file specified.
Code: 80070002
Source: (null)


The path is definitely correct. Example;
Code:
WshShell.Run("C:\\Program Files\\example\\blah.exe");


What could be causing the problem?
 
Thanks a lot for the help.

Forgive my noobishness, but wouldn't that method depend on both exe files being in the same folder?
If so, what I'm trying to do makes that impossible.
 
Back
Top Bottom