Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted

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 *

Posted

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

Posted

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.

Posted

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

Posted

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 *

Posted

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'

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
  • Recently Browsing   0 members

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