pshankland Posted January 22, 2008 Posted January 22, 2008 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.
Swift Posted January 22, 2008 Posted January 22, 2008 If no one is logged in...this isnt possible. Sorry.
Shevilie Posted January 22, 2008 Posted January 22, 2008 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
Swift Posted January 22, 2008 Posted January 22, 2008 Thought of that...alot of work just to run 1 program if no one is logged in...
/dev/null Posted January 22, 2008 Posted January 22, 2008 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 *
Shevilie Posted January 22, 2008 Posted January 22, 2008 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 Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit
weaponx Posted January 22, 2008 Posted January 22, 2008 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.
pshankland Posted January 22, 2008 Author Posted January 22, 2008 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 TasksRight 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.
/dev/null Posted January 22, 2008 Posted January 22, 2008 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!CheersKurt __________________________________________________________(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 *
pshankland Posted January 29, 2008 Author Posted January 29, 2008 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'
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now