4 posts in this topic
Run(@ComSpec...) with schtasks
I have this button in an app I am building:
When you click it, it then opens a FileOpenDialog() I select and XML, then it asks for a name input, enter the name, then it should run the following code:
schtasks.exe /create /tn XXXX-task /XML C:\WBRESO~1\WB-LOO~1\TESTIN~1.XML It works when I put it in the CMD and run it, I get SUCCESS! and the new task has been created in Task Scheduler.
C:\Users\vivaed>schtasks.exe /create /tn XXXX /xml C:\WBRESO~1\WB-LOO~1\TESTIN~1.XML SUCCESS: The scheduled task "XXXX" has successfully been created. But when I run it in:
(This is just a snippet of the code, there is a lot more)
#include <AutoItConstants.au3> Global $wbResources = 'C:\"WB Resources"\WB-LoopChecker\' Case $Button4 $getXML = FileOpenDialog("Find task to import", $wbResources ,"XML (*.xml)") If @error Then ; Display the error message. MsgBox($MB_SYSTEMMODAL, "", "No file was selected.") Else Local $taskName = InputBox("Name this task","File: " & @CRLF & $getXML & @CRLF & "Name this task:" & @CRLF,"XXXX-task") $schedTask = 'schtasks.exe /create /tn ' & $taskName & ' /XML ' & FileGetShortName($getXML) Run(@ComSpec & " /c " & $schedTask, @SW_HIDE) ConsoleWrite($wbResources & @CRLF) ConsoleWrite($schedTask & @CRLF) EndIf Here I dont get any errors but the when I refresh the Task Scheduler, there is no new task....
Run command doen't work
I've some troubles whit the run command.
Below u see 2 command's , 1 is working and the other not. (the first isn't working)
I think the problem is in te space between program and files.Also I've treid every thing i could think of or the helpfiles handed to me.
(or maybe I din't find the correct answer:))
I tried so mush that i don't know anymore if it's the space between program files or not.
Could somebody point me in the right direction?
Run(@ComSpec & " /c psexec -i \\127.0.0.1 -u username -p pass -h -d /accepteula C:\Program Files\some_prog\Shell.exe" ,"C:\tools", @SW_HIDE) Working :
Run(@ComSpec & " /c psexec -i \\127.0.0.1 -u username -p pass /accepteula cmd" , "C:\tools" , @SW_HIDE)
Check wether AutoitScript has finished
How can I check wether my current autoitscript (.exe) has finished,
my problem is that I have a button which starts the autoit, if the user clicks twice in the button or more times the script shall check if its runs or not
Run Command in Shell Execute
How can I run this command:
Send( 'C:\xampp\htdocs\myApp\BuildDVD.exe ..\..\projects\dvdrom\' & $sFileName & '\project.xml ..\..\projects\' & $sFileName & '\video')
in a Shell Execute?
I can run
but how to I add the rest of the command?
Dont work StdoutRead with Putty.exe
$user = "root" $password ="" $host ="188.8.131.52" $port ="22" $puty_exe = @ScriptDir & "\putty.exe"; putty salve local folder script $command = Run(@comspec & " /C "&$puty_exe&" -ssh -l "&$user&" "&$host&" p "&$port&" -pw "&$password,@ScriptDir, @SW_HIDE, 1) While 1 $data = StdoutRead($command) ConsoleWrite($data&@CRLF) If @error Then ExitLoop Wend Why StdoutRead cant read what putty.exe write in console ?