gcue Posted December 18, 2008 Share Posted December 18, 2008 im having trouble getting this command to work.. its definitely a quotes issue trying to get quotes right around the "shutdown...... /st" and quotes around the $Guictrlread($message) Run(@ComSpec & ' /c schtasks /create /s \\' & $asset & ' /Ru SYSTEM /sc once /tn Dashboard-Restart /tr "shutdown -r -f -t 300 -c ' & '"' & GUICtrlRead($message) & '"' & '" /st ' & GUICtrlRead($time), "", @SW_HIDE) thanks Link to comment Share on other sites More sharing options...
Josbe Posted December 18, 2008 Share Posted December 18, 2008 im having trouble getting this command to work.. its definitely a quotes issue trying to get quotes right around the "shutdown...... /st" and quotes around the $Guictrlread($message) Run(@ComSpec & ' /c schtasks /create /s \\' & $asset & ' /Ru SYSTEM /sc once /tn Dashboard-Restart /tr "shutdown -r -f -t 300 -c ' & '"' & GUICtrlRead($message) & '"' & '" /st ' & GUICtrlRead($time), "", @SW_HIDE)oÝ÷ ÚØZK?ªê-y«¢+ØÀÌØíÍ=ÕÑÁÕÑQÍÐôÌäì½Í¡ÑÍ̽ÉѽÌÀäÈìÀäÈìÌäìµÀìÀÌØíÍÍеÀìÌäì½IÔMeMQ4½Í½¹½Ñ¸Í¡½ÉµIÍÑÉнÑÈÅÕ½ÐíÍ¡ÕѽݸµÈµµÐÌÀÀµÌäìµÀìÌäìÅÕ½ÐìÌäìµÀìU% ÑɱI ÀÌØíµÍͤµÀìÌäìÅÕ½ÐìÌäìµÀìÌäìÅÕ½Ðì½ÍÐÌäìµÀìU% ÑɱI ÀÌØíÑ¥µ My first try would be verify this. Check this using ConsoleRead($sOutputTest) or MsgBox(0, 0, $sOutputTest). AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
Developers Jos Posted December 18, 2008 Developers Share Posted December 18, 2008 (edited) i think you have 2 closing doublequotes: GUICtrlRead($message) & '"' & '" /st ' Edited December 18, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
gcue Posted December 18, 2008 Author Share Posted December 18, 2008 i tried that.. looks okMy first try would be verify this. Check this using ConsoleRead($sOutputTest) or MsgBox(0, 0, $sOutputTest). Link to comment Share on other sites More sharing options...
gcue Posted December 18, 2008 Author Share Posted December 18, 2008 i tried taking them off but it doesnt work...i need that second " close because of the one i start before "shutdowni think you have 2 closing doublequotes: GUICtrlRead($message) & '"' & '" /st ' Link to comment Share on other sites More sharing options...
Developers Jos Posted December 18, 2008 Developers Share Posted December 18, 2008 You are sure that command works when ran from the CMD prompt? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
gcue Posted December 18, 2008 Author Share Posted December 18, 2008 yep heres the command that works schtasks /create /s \\d0075931 /Ru SYSTEM /sc once /tn dashboard-restart /tr "shutdown -r -f -t 9999 -c "eh"" /st 07:00:00 Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 18, 2008 Share Posted December 18, 2008 yep heres the command that works schtasks /create /s \\d0075931 /Ru SYSTEM /sc once /tn dashboard-restart /tr "shutdown -r -f -t 9999 -c "eh"" /st 07:00:00 If that line works from the command line (including the doubled double quote) then it should run fine like this: $sExtCmd = 'schtasks /create /s \\' & $asset & ' /Ru SYSTEM /sc once /tn dashboard-restart ' & _ '/tr "shutdown -r -f -t 9999 -c "eh"" /st 07:00:00' Run($sExtCmd, @TempDir) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
gcue Posted December 18, 2008 Author Share Posted December 18, 2008 including both guictrlreads? guictrlread($message) and guictrlread($time) thats where im coming acrross probs Link to comment Share on other sites More sharing options...
Josbe Posted December 18, 2008 Share Posted December 18, 2008 yepheres the command that worksschtasks /create /s \\d0075931 /Ru SYSTEM /sc once /tn dashboard-restart /tr "shutdown -r -f -t 9999 -c "eh"" /st 07:00:00what about using single-quotes around GUICtrlRead($message) ? Well, first try the PsaltyDS suggestion. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
Developers Jos Posted December 18, 2008 Developers Share Posted December 18, 2008 Just tried this version which worked for me:Run(@ComSpec & ' /c schtasks /create /Ru SYSTEM /sc once /tn dashboard-restart /tr "shutdown -r -f -t 9999 -c "eh"" /st 07:00:00', "", @SW_HIDE)It creates the same task when run from the CMD line. But both results have the doublequotes missing around eh when displaying it in the taskscheduler.I cannot test doing this for a networked system.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 18, 2008 Share Posted December 18, 2008 including both guictrlreads? guictrlread($message) and guictrlread($time) thats where im coming acrross probs Sorry, forgot that part: $sMsg = GUICtrlRead($message) $sTime = GUICtrlRead($time) $sExtCmd = 'schtasks /create /s \\' & $asset & ' /Ru SYSTEM /sc once /tn dashboard-restart ' & _ '/tr "shutdown -r -f -t 9999 -c "' & $sMsg & '"" /st ' & GUICtrlRead($time) ConsoleWrite("Debug: $sMsg = " & $sMsg & @LF) ConsoleWrite("Debug: $sTime = " & $sTime & @LF) ConsoleWrite("Debug: $sExtCmd = " & $sExtCmd & @LF) Run($sExtCmd, @TempDir) Included a debug display of the values for troubleshooting. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
gcue Posted December 18, 2008 Author Share Posted December 18, 2008 no dice psalty =/ i like the idea of seperating everything tho Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 18, 2008 Share Posted December 18, 2008 (edited) no dice psalty =/That's not a helpful description for further troubleshooting... What happened when you tried it? Post the console output. Edited December 18, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
gcue Posted December 18, 2008 Author Share Posted December 18, 2008 hehe sorry.. how do i get the console output? never knew how to do that i tried console read.. but not sure how to output Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 18, 2008 Share Posted December 18, 2008 hehe sorry.. how do i get the console output? never knew how to do thati tried console read.. but not sure how to outputRun it from SciTE and ConsoleWrite() writes to the console pane at the bottom of the SciTE window. Or, you could change the ConsoleWrite() functions to MsgBox() or even _FileWriteLog() to collect the debug info. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
gcue Posted December 18, 2008 Author Share Posted December 18, 2008 (edited) ooooo neaat! Debug: $sMsg = I am restarting your machine because ____. Please call x___ for questions. Debug: $sTime = 10:00:00 Debug: $sExtCmd = schtasks /create /s \\d0091119 /Ru SYSTEM /sc once /tn dashboard-restart /tr "shutdown -r -f -t 300 -c "I am restarting your machine because ____. Please call x___ for questions."" /st 10:00:00 i figured out that it doesnt like the spacing in the $sMsg.. bc if i take out the spaces it works... hmm can i add the spaces at the end of the process??? or what else can i try? thanks for your help with this fellas. Edited December 18, 2008 by gcue Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 18, 2008 Share Posted December 18, 2008 ooooo neaat! Debug: $sMsg = I am restarting your machine because ____. Please call x___ for questions. Debug: $sTime = 10:00:00 Debug: $sExtCmd = schtasks /create /s \\d0091119 /Ru SYSTEM /sc once /tn dashboard-restart /tr "shutdown -r -f -t 300 -c "I am restarting your machine because ____. Please call x___ for questions."" /st 10:00:00 i figured out that it doesnt like the spacing in the $sMsg.. bc if i take out the spaces it works... hmm can i add the spaces at the end of the process??? or what else can i try? thanks for your help with this fellas. I get it now... the shell command line for schtasks cannot nest literal quotes for the contained commandline for shutdown. Try escaping the literal quotes with '\"' like this: $sMsg = GUICtrlRead($message) $sTime = GUICtrlRead($time) $sExtCmd = 'schtasks /create /s \\' & $asset & ' /Ru SYSTEM /sc once /tn dashboard-restart ' & _ '/tr "shutdown -r -f -t 9999 -c \"' & $sMsg & '\"" /st ' & $sTime ConsoleWrite("Debug: $sMsg = " & $sMsg & @LF) ConsoleWrite("Debug: $sTime = " & $sTime & @LF) ConsoleWrite("Debug: $sExtCmd = " & $sExtCmd & @LF) Run($sExtCmd, @TempDir) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
gcue Posted December 18, 2008 Author Share Posted December 18, 2008 ok is there anything penguins cant do other than fly?errrrrrr can you fly?thanks bud!!!!!!!! Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 18, 2008 Share Posted December 18, 2008 ok is there anything penguins cant do other than fly?errrrrrr can you fly?That's a terribly insensitive question! I can't believe you asked that!No <sniffle>, penguins can't fly... go ahead and rub it in why don't you? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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