owensct Posted September 28, 2010 Share Posted September 28, 2010 Hi All, I have this RunWait command in a script I am writing. I don't get any errors, it just doesn't run. I've stared at it until my eyes are crossed . Can anybody see what I'm missing as I can't seem to figure out where I have it incorrectly written. Any help would be appreciated. RunWait('robocopy196 \\rhp-vms-001\ANSOSONESTAFF\data\ \\rhp-vms-001\Staff_backups\Daily_%date:~4,2%%date:~7,2%%date:~12,2%_%time:~0,2%%time:~3,2%%time:~6,2% *.* /s /e /log:\\rhp-vms-001\Staff_backups\Dailylog_%date:~4,2%%date:~7,2%%date:~12,2%_%time:~0,2%%time:~3,2%%time:~6,2%.log') The command works fine from a command line, but when I try to set it up to execute via RunWait, the script acts like its doing what it's supposed to but it never completes the copy operation. Sorry if this is a dumb question, I'm new to AutoIt. Link to comment Share on other sites More sharing options...
Gestalt Posted September 28, 2010 Share Posted September 28, 2010 Rather than RunWait(), you can instead Run() the program and then use ProcessWaitClose() to pause until the process is finished. Link to comment Share on other sites More sharing options...
owensct Posted September 28, 2010 Author Share Posted September 28, 2010 Hi All,I have this RunWait command in a script I am writing. I don't get any errors, it just doesn't run. I've stared at it until my eyes are crossed . Can anybody see what I'm missing as I can't seem to figure out where I have it incorrectly written. Any help would be appreciated.RunWait('robocopy196 \\rhp-vms-001\ANSOSONESTAFF\data\ \\rhp-vms-001\Staff_backups\Daily_%date:~4,2%%date:~7,2%%date:~12,2%_%time:~0,2%%time:~3,2%%time:~6,2% *.* /s /e /log:\\rhp-vms-001\Staff_backups\Dailylog_%date:~4,2%%date:~7,2%%date:~12,2%_%time:~0,2%%time:~3,2%%time:~6,2%.log')The command works fine from a command line, but when I try to set it up to execute via RunWait, the script acts like its doing what it's supposed to but it never completes the copy operation.Sorry if this is a dumb question, I'm new to AutoIt. All,Well I have this sort of figured out, the only issue I have now is in trying to append the date and time to the name of the folder that teh job creates:This works in AutoItRunWait('robocopy "\\rhp-vms-001\backuptest" "\\rhp-vms-001\Staff_backups\Daily_"/COPYALL /S /E /V /LOG+:"\\rhp-vms-001\staff_backups\ROBOCOPY_LOG.txt"')This works on the command linerobocopy \\rhp-vms-001\backuptest \\rhp-vms-001\Staff_backups\Daily_%date:~4% /COPYALL /S /E /V /LOG:\\rhp-vms-001\staff_backups\ROBOCOPY_LOG.txtThis yeilds a folder in the Staff_backup folder called Daily_09I have tried various means of accomplishing the same thing in AutoIt and so far no success:None of these workRunWait('robocopy "\\rhp-vms-001\backuptest" "\\rhp-vms-001\Staff_backups\Daily_%date:~4%" /COPYALL /S /E /V /LOG+:"\\rhp-vms-001\staff_backups\ROBOCOPY_LOG.txt"')orRunWait('robocopy "\\rhp-vms-001\backuptest" "\\rhp-vms-001\Staff_backups\Daily_" '%date:~4%' /COPYALL /S /E /V /LOG+:"\\rhp-vms-001\staff_backups\ROBOCOPY_LOG.txt"')orRunWait('robocopy "\\rhp-vms-001\backuptest" "\\rhp-vms-001\Staff_backups\Daily_" %date:~4% /COPYALL /S /E /V /LOG+:"\\rhp-vms-001\staff_backups\ROBOCOPY_LOG.txt"')orRunWait('robocopy "\\rhp-vms-001\backuptest" "\\rhp-vms-001\Staff_backups\Daily_" &%date:~4%& /COPYALL /S /E /V /LOG+:"\\rhp-vms-001\staff_backups\ROBOCOPY_LOG.txt"')or$line = '%date:~4% 'RunWait('robocopy "\\rhp-vms-001\backuptest" "\\rhp-vms-001\Staff_backups\Daily_" '& $line &' /COPYALL /S /E /V /LOG+:"\\rhp-vms-001\staff_backups\ROBOCOPY_LOG.txt"')Can somebody clue me into what is wrong with my syntax? This is driving me crazy and I'm trying to meet a deadline to get this tested and in production. ThanksGordon Link to comment Share on other sites More sharing options...
Chimaera Posted September 29, 2010 Share Posted September 29, 2010 Just from the basis of looking at it, and bearing in mind im a noob with Autoit...The obvious factor between the ones that work in Autoit and the ones that don't is the %date:~4%The one that works in cmd is prob cos the %date% parameter is nativeCan you not set the date but add it after the robocopy in the log maybe so it dosen't conflict?Please bear in mind i definatly dont know about Autoit ;o)In cmd i do thisset t=2&if "%date%z" LSS "A" set t=1 for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('echo.^|date') do ( for /f "tokens=%t%-4 delims=.-/ " %%d in ('date/t') do ( set %%a=%%d&set %%b=%%e&set %%c=%%f))which gives me %dd%.%mm%.%yy% If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
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