Sign in to follow this  
Followers 0
larcerkev

Change System Time?

9 posts in this topic

I've tried to use a command such as

_RunDOS('time 17:15:00.00')

But it give me an error, how would I be able to change the time to something new?

Share this post


Link to post
Share on other sites



To time not seen before?

Error you got indicates the solution.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

To time not seen before?

Error you got indicates the solution.

Sorry I should have put it in there.

ERROR: _RunDOS(): undefined function.

_RunDOS('time 17:15:00.00')

Share this post


Link to post
Share on other sites

_RunDOS is not built-in function, it's defined in file called Process.au3. To be able to use it you have to "include" that file to your script.

#include <Process.au3>

_RunDOS('time 17:15:00.00')

Still, very likely time wouldn't change, this time not because of syntax error but one of semantic nature.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Something to think about:

#include <Process.au3>
#RequireAdmin
$NewTime = '17:15:00.00'
_RunDOS('echo ' & $NewTime & '>> %temp%\tmp.tmp&&time<%temp%\tmp.tmp&&del %temp%\tmp.tmp')

Share this post


Link to post
Share on other sites

Adding the #include solved the problem, I feel kind of stupid for overlooking that.

Share this post


Link to post
Share on other sites

Something to think about:

#include <Process.au3>
#RequireAdmin
$NewTime = '17:15:00.00'
_RunDOS('echo ' & $NewTime & '>> %temp%\tmp.tmp&&time<%temp%\tmp.tmp&&del %temp%\tmp.tmp')

JoHanatCent,

Can you tell me what the temp line does? I believe it redirects the output to a temporary file and then deletes it, but I don't know it's purpose. Also, what does the middle "&&time<%temp%\tmp.tmp&&" portion of it do?

Share this post


Link to post
Share on other sites

JoHanatCent,

Can you tell me what the temp line does? I believe it redirects the output to a temporary file and then deletes it, but I don't know it's purpose. Also, what does the middle "&&time<%temp%\tmp.tmp&&" portion of it do?

I think I figured it out myself!! It outputs the time to a temporary file, calls the time command with the input being that time, then deletes the file :)

Does that get around not having admin rights?

Share this post


Link to post
Share on other sites

In Vista you need the

#RequireAdmin

else it will ignore you!


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0