sipeys Posted May 29, 2015 Posted May 29, 2015 Hi I have written a script in autoIT to make a backup of an exchange mailbox on small business server 2011. I am not very experienced with autoIT but the script works when I double click it. My problem is that I scheduled it to run every day in task scheduler, and task scheduler says that it ran successfully, but it did not make the backup. Does anyone know why it is not working?Here is the script:Send("{LWIN}");Presses left windows keySleep(2000);waits two secondsSend("Exchange Management Shell");Enters textSleep(2000);waits two secondsSend("{ENTER}");Opens Exchange Management ShellSleep(30000);waits 30 seconds$EnterString1 = "New-MailboxExportRequest -Mailbox pielmeier -FilePath \\Susan-pc\alwi\mailboxbackups\Dave\"$EnterString2 = "davemailbox-" & @MON & "-" & @MDAY & "-" & @YEAR & "-" & @HOUR & "-" & @MIN & ".pst"Send($EnterString1);Enters commandSleep(2000);waits two secondsSend($EnterString2);enters commandSleep(2000);waits two secondsSend("{ENTER}");Presses enterSleep(30000);waits 30 secondsSend("exit");types ExitSleep(2000);waits two secondsSend("{ENTER}");Presses enter
BrewManNH Posted May 29, 2015 Posted May 29, 2015 That script won't work unless the server is logged on to and it is running visible, neither of which are probably true. https://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
jalexandar Posted January 8, 2019 Posted January 8, 2019 Build the AutoIT script and make it to an exe. Call this exe in a bat file. You can then schedule the bat file in the Schedule task.
Moderators JLogan3o13 Posted January 8, 2019 Moderators Posted January 8, 2019 @jalexandar did you happen to notice this post is over 3 years old? Please don't resurrect old threads, especially to give incorrect suggestions. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Recommended Posts