bourny Posted July 5, 2004 Posted July 5, 2004 I need to do a runwait with variables ... how would I do this ... Example script below - problem in redI dont think you can use runwait in this way however can anyone suggest a workaround$a="@comspec & ' /c Dir /b /s c:\*." $c=" >> c:\whwash\cfile.wash',@scriptdir,@SW_HIDE" FileCopy ("\\Servername\whwash\Suffix\suffix.wash", "c:\whwash\suffix.wash" ,1 )$suffix_open=FileOpen("c:\whwash\suffix.wash", 0) If $suffix_open = -1 Then $fail = FileOpen("c:\whwash\whfail.log", 1) FileWriteLine($fail, "Script Failed - Could not open suffix.wash") FileClose($fail) ExitEndIfWhile 1 $suffix = FileReadLine($suffix_open) If @error = -1 Then ExitLoop RunWait ($a & $suffix & $C)Wend FileClose("$suffix_open")Bourny....
jpm Posted July 5, 2004 Posted July 5, 2004 (edited) change the c$ setting because the workindir and the flag cannot come with the end of the first parameter$c=" >> c:\whwash\cfile.wash'".....RunWait ($a & $suffix & $C, @scriptdir, @SW_HIDE) Edited July 5, 2004 by jpm
bourny Posted July 5, 2004 Author Posted July 5, 2004 I have tried your suggestion but this does not work... Am Imisunderstanding your comment... new script below $a="@comspec & ' /c Dir /b /s c:\*." $c=" >> c:\whwash\cfile.wash'" FileCopy ( "\\servername\whwash\Suffix\suffix.wash", "c:\whwash\suffix.wash" ,1 ) $suffix_open=FileOpen("c:\whwash\suffix.wash", 0) If $suffix_open = -1 Then $fail = FileOpen("c:\whwash\whfail.log", 1) FileWriteLine($fail, "Whitewash Script Failed - Could not open suffix.wash") FileClose($fail) Exit EndIf While 1 $suffix = FileReadLine($suffix_open) If @error = -1 Then ExitLoop ;RunWait ($a & $suffix & $C) RunWait ($a & $suffix & $C, @scriptdir, @SW_HIDE) Wend FileClose("$suffix_open") bourny
SlimShady Posted July 5, 2004 Posted July 5, 2004 Try this: $a = @comspec & ' /c Dir /b /s c:\*.' $c = ' >> c:\whwash\cfile.wash' FileCopy("\\servername\whwash\Suffix\suffix.wash", "c:\whwash\suffix.wash", 1) $suffix_open = FileOpen("c:\whwash\suffix.wash", 0) If $suffix_open = -1 Then $fail = FileOpen("c:\whwash\whfail.log", 1) FileWriteLine($fail, "Whitewash Script Failed - Could not open suffix.wash") FileClose($fail) Exit EndIf While 1 $suffix = FileReadLine($suffix_open) If @error = -1 Then ExitLoop ;RunWait ($a & $suffix & $C) RunWait ($a & $suffix & $C, @scriptdir, @SW_HIDE) Wend FileClose("$suffix_open")
bourny Posted July 5, 2004 Author Posted July 5, 2004 Thanks Slim.. Looks like if I read you correct I was using "" when this was unnecessary for the variable Bourny...
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