4 posts in this topic
Running PS1 Script with Parameters
Trying to automate the sideload of a Windows Store app via .ps1 script...
RunWait(@ComSpec & ' /c' & 'C:\"WB Resources"\APP_Prod\Add-AppDevPackage.ps1') Above doesn't work... I assume this is trying to open in CMD.
Normally we right click the .ps1 and open with powershell, then we have to type "A" to start the install, it installs and then type any yet to exit.
However I cant get the powershell to even open.
Kind of puzzled here, any suggestions would be a help.
PS I also tried to convert the .ps1 to exe, but that was a huge failure... lol
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?