Jump to content

Run program when logged out?


Recommended Posts

Am sure this is a bit of an easy question to answer but...

I am writing a small script which will backup a MySQL DB using the 'mysqlsump' command. I realise I could use the 'Send' command to open cmd.exe and then send the text I want, but I need to run this program as a scheduled task when there is no user logged into the machine.

Basically the command I need to run is:

mysqldump -l --user=username --password=password --add-drop-table db > c:\backup\mysql.db

Can someone show me an example of how to run this in AutoIT so it runs when the user isn't logged in?

Thanks.

Link to comment
Share on other sites

mysqldump -l --user=username --password=password --add-drop-table db > c:\backup\mysql.db

Can someone show me an example of how to run this in AutoIT so it runs when the user isn't logged in?

run your script as a service: #304562

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

He already answered his own question. Add it to the task scheduler and it will run logged off...

Open Start > Programs > Accessories > System Tools > Scheduled Tasks

Right click your task, select properties. "Run only if logged on" is unchecked by default.

Link to comment
Share on other sites

He already answered his own question. Add it to the task scheduler and it will run logged off...

Open Start > Programs > Accessories > System Tools > Scheduled Tasks

Right click your task, select properties. "Run only if logged on" is unchecked by default.

Thanks everyone for the replies but it dosn't work even when scheduled. Also, "Run only if logged on" isn't an option, at least with Windows 2000 Professional.

post-16707-1201029650_thumb.png

Link to comment
Share on other sites

Thanks everyone for the replies but it dosn't work even when scheduled. Also, "Run only if logged on" isn't an option, at least with Windows 2000 Professional.

it will run as a service, as long as you don't try to use any Win* oder Send* functions, which is completely useless if nobody is logged in!

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...