Sign in to follow this  
Followers 0
pshankland

Run program when logged out?

12 posts in this topic

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.

Share this post


Link to post
Share on other sites



If no one is logged in...this isnt possible. Sorry.

Share this post


Link to post
Share on other sites

Gutted - thanks for the reply.

Share this post


Link to post
Share on other sites

You might be able to run it as a service... That starts when the computer is turned on - though you would have the timer build in the program...


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

Thought of that...alot of work just to run 1 program if no one is logged in...

Share this post


Link to post
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 *

Share this post


Link to post
Share on other sites

Thought of that...alot of work just to run 1 program if no one is logged in...

Hes question was not if it was diffecult.. it was, is it possible :D

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Good :D

Share this post


Link to post
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

Share this post


Link to post
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 *

Share this post


Link to post
Share on other sites

Just found out that _RunDos is the command I was after, this does allow you to run programs such ask mysqldump without being logged in as it dosn't require the cmd prompt to be 'open'

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