Search the Community
Showing results for tags 'Run'.
-
This is the AutoIt script I'm using: #include <AutoItConstants.au3> Local $Python = "C:\Program Files\Python38" Local $Script = "levenstein.py" Local $String1Path = @ScriptDir & "\string1.txt" Local $String2Path = @ScriptDir & "\string2.txt" Local $Arguments = '"' & $String1Path & '" "' & $String2Path & '"' Local $Concat = $Script & " " & $Arguments ConsoleWrite(@CRLF & $Concat) Local $RunIt = Run(@ComSpec & " /c " & $Concat, @ScriptDir, @SW_HIDE, $STDERR_MERGED) $Output = StdOutRead($RunIt) ConsoleWrite(@CRLF & "Output:" & $Output) It calls the following Python script (levenstein.py): import re import sys import editdistance def main(): # Check if there are 2 command line arguments if len(sys.argv) != 3: print("Error: Two file paths must be provided") return # Read the contents of the files filepath1 = sys.argv[1] filepath2 = sys.argv[2] string1 = read_file_contents(filepath1) string2 = read_file_contents(filepath2) # Calculate and print the similarity between the two strings similarity = calculate_similarity(string1, string2) print(similarity) def read_file_contents(filepath): # Read the contents of a file into a string with open(filepath, 'r') as f: return f.read() def calculate_similarity(string1, string2): # Calculate the similarity between two strings return 100 - (100 * editdistance.eval(string1, string2) / max(len(string1), len(string2))) # Run the main function if __name__ == '__main__': main() It's working when I run it from cmd, but not when I use AutoIt. My AutoIt console looks like this: levenstein.py "C:\test\Autoit Python\string1.txt" "C:\test\Autoit Python\string2.txt" Output: Whereas when I run the exact same command in cmd levenstein.py "C:\test\Autoit Python\string1.txt" "C:\test\Autoit Python\string2.txt" I get an output that's more like 77.08934 which is what I would expect from the .py script. I believe I must be making a mistake in the way I'm using the Run command. Note: I'm using Python for Edit Distance because the files I'm comparing are rather large, and I'm not sure if the code snippets I found in the Autoit forum would be effective.
- 10 replies
-
Hi Team, Greetings! One silly doubt, I need to pass one parameter using RunWait to write an output to a file using Cmd Line, but the below isn't writing to the file specified. Kindly assist. $pass = $CmdLine[1] $CMD = "C:\Progra~1\bin\Encrypt.exe" &$pass& " > C:\temp\pwd.txt" #write the parameter $pass in C:\temp\pwd.txt RunWait(@ComSpec & " /c " & $CMD,"",@SW_HIDE) Thank you!!
-
A new quick/small UDF. #include-once #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Global $RUN_WRAPPER_PID Global Enum _ $RUNWRAPPER_ERR_SUCCESS, _ $RUNWRAPPER_ERR_GENERAL, _ $RUNWRAPPER_ERR_COUNTER Global Enum _ $RUNWRAPPER_EXT_DEFAULT, _ $RUNWRAPPER_EXT_NOT_FINISHED_YET, _ $RUNWRAPPER_EXT_COUNTER If Not @Compiled And @ScriptName = 'Run_Wrapper.au3' Then _Example_for_Run_Wrapper() Func _Example_for_Run_Wrapper() _Run_Wrapper('ping 8.8.8.8') If @error then Return SetError(@error, @extended, 0) While $RUN_WRAPPER_PID Sleep(10) _Run_Wrapper_GetStdout() If @error Then _Run_Wrapper_GetStderr() If @error Then ExitLoop EndIf WEnd MsgBox($MB_OK + $MB_TOPMOST + $MB_ICONINFORMATION, 'Information #' & @ScriptLineNumber, _ _Run_Wrapper_GetStdout() & @CRLF & _ _Run_Wrapper_GetStderr() _ ) EndFunc ;==>_Example_for_Run_Wrapper Func _Run_Wrapper($sCommand) _Run_Wrapper_GetStdout(Null) _Run_Wrapper_GetStderr(Null) $RUN_WRAPPER_PID = Run(@ComSpec & " /c " & $sCommand, @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) If @error Then Return SetError($RUNWRAPPER_ERR_GENERAL, $RUNWRAPPER_EXT_DEFAULT, 0) Return $RUN_WRAPPER_PID EndFunc ;==>_Run_Wrapper Func _Run_Wrapper_GetStdout($v_Reset = Default) Local Static $s_StdOut = "" If IsKeyword($v_Reset) And $v_Reset = Null Then $s_StdOut = '' $s_StdOut &= StdoutRead($RUN_WRAPPER_PID) If @error Then Return SetError(@error, $RUNWRAPPER_EXT_DEFAULT, $s_StdOut) Return SetExtended($RUNWRAPPER_EXT_NOT_FINISHED_YET, $s_StdOut) EndFunc ;==>_Run_Wrapper_GetStdout Func _Run_Wrapper_GetStderr($v_Reset = Default) Local Static $s_StdErr = '' If IsKeyword($v_Reset) And $v_Reset = Null Then $s_StdErr = '' $s_StdErr &= StderrRead($RUN_WRAPPER_PID) If @error Then Return SetError(@error, $RUNWRAPPER_EXT_DEFAULT, $s_StdErr) Return SetExtended($RUNWRAPPER_EXT_NOT_FINISHED_YET, $s_StdErr) EndFunc ;==>_Run_Wrapper_GetStderr
-
Hi All, Trying to open windows explorer to a WebDav location and it's not working quite how I want, on the computers it is setup as a "network location" (as opposed to a "mapped drive", and this unfortunately can't be changed), the "Data" WebDav folder sits directly under "This PC" if that's an easier way to get to it. any suggestions as to what I can correct to get the 2nd example to work? ; This works, but I'm trying to avoid this as users normally see the URL style in the 2nd example below $folderToOpen = "\\mycompany.sharepoint.com@SSL\DavWWWRoot\Data" Run("Explorer.exe " & $folderToOpen) ; This does not work, it tries to open the WebDav url in the default web browser $folderToOpen = "https://mycompany.sharepoint.com/Data" Run("Explorer.exe " & $folderToOpen) ShellExecute also opens it in the default browser. Saw _WinAPI_ShellOpenFolderAndSelectItems but couldn't get the 2nd example to work. If I manually open Windows Explorer and paste in https://mycompany.sharepoint.com/Data it loads the WebDav directory without issue. If I have to use the pathing from the first example it is fine, just trying to give users a familiar experience. Thanks!
-
hello autoit team is there any wey to check if any process run as admin or no? i mean e.g if i want to restart any process, now i have the ability to get the process path and commands line what i need is a wey to check if the process was runing as admin or no to restart it with the same state. here is the part that am using it to restart the process func _processRestart($i_pid, $s_ProcessPath) if not (ProcessExists($i_ProcessPid)) then return SetError(1, 0, -1) local $s_ProcessWorkDir = _WinAPI_GetProcessWorkingDirectory($i_ProcessPid) ProcessClose($i_ProcessPid) ProcessWaitClose($i_ProcessPid) ProcessWait(ShellExecute($i_pid,"", $s_ProcessWorkDir)) ProcessesGetList() return true endFunc thanks in advance
-
So I just got a new computer, and instantly went and installed Autoit onto it. I selected run script as default action when clicking on an au3 file, however every time I do this it opens the script in the editor. I can from there run the script no problem. I've tried reinstalling and checking the settings by hitting "Ctrl+1" and have confirmed it is set to run, but yet it just continues to open in the editor. Any ideas why this is happening or how to solve? New system is windows 10, old was windows 7
-
Hi AutoIters! Im trying to launch a .exe file that is nested within the program files (x86) folder structure. i have already used the standard RunAs Syntax and found that it fails to launch the application. I have switched to Run and that seems to work. My issue is I have to use RunAs as the applicaton would need to run under a completely different account. The Current logged in user is a Local User on the machine, however, the application must be run as a domain user. The Machine is domain connected. have tried the following: RunAs("username","logonpassword", $RUN_LOGON_PROFILE, "D:\Program Files (x86)\Vendor\Application Name\Exe Location\Executable.exe") The above fails to launch, there are no errors or syntax issues, it just does nothing when the variables are replaced for the correct values. I did the same using the Run command Run("D:\Program Files (x86)\Vendor\Application Name\Exe Location\Executable.exe") That seems to work fine, but runs in local user context. Any thoughts? Could it be a local Machine rights issue? Or have i missed something glaring in my script
-
Hello i have searched a lot about how to run external programs with the administrator privileges without the script running with administrator privileges using autoit But all my attempts failed Finally, today I found the VBS function doing this task I immediately transferred it to our beloved language (autoit) and i decided to share it with you i hope you like it This is a simple example about how to use the function runAsAdmin("cmd.exe", "/c @echo off & cls & echo test & pause", "c:\", @sw_show) this is the function func runAsAdmin($program, $parameters = "", $workingDir = @workingDir, $show = "") local $oShell = OBJCreate("Shell.Application") if isOBJ($oShell) then local $result = $oShell.ShellExecute($program, $parameters, $workingDir, "runas", $show) else $result = false endIf return $result endFunc
-
[SOLVED]Run command stopped execution
PoojaKrishna posted a topic in AutoIt General Help and Support
Hi friends, The Run command on my machine suddenly stopped execution. Anyone of you facing the same issue? #include <AutoItConstants.au3> #include <FileConstants.au3.> #RequireAdmin $ExeName = FileOpenDialog("Select AutoIt executable", @ScriptDir & "\", "(*.exe)", $FD_FILEMUSTEXIST) If not @error Then If FileExists($ExeName) Then $iPID = Run($ExeName, "", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) If @error Then msgbox(0,"Failed", "Failed execution with @error: " & @error) EndIf Else Msgbox(0,"", "File does not exist") EndIf EndIf The above code always fails to execute the executable file. It was working perfect and stopped working now. I have tried adding the files and folders to windows defender exclusion list and uninstalling the anti virus but still no luck. OS: Windows 10 - 64 bit Please help. -
Hello, for a script to display PDF files I'd like to simply use the default program for PDF files, so I used "ShellExecute(<pdf-file-full-path>)" to open these files. The result for *SOME* of the workstations is, that the Adobe Reader starts up with asking for its language. (English/German). When starting AcroRd32.exe through "ShellExecute()", this "choose your language" dialog is showing up *ALWAYS*. Just to have mentioned it: Process Explorer is presenting this command line, it looks the same for both, PCs with and without that question "Choose Language? [English|German]" "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" --channel=4680.0.860715181 --type=renderer "\\pc0009\Y_DRV_H\Daten\TIF\08\32\G000110832_Freigegeben.idw.pdf" The next approach I thought of was to use Foxit Portable (instead of Acrord32.exe), started from a Network Drive, but it's starting up ugly slowly... So I tried to "Run()" instead to "ShellExecute()" the Adobe Reader. Now the result looks more stange, the "select your language" dialog shows up every now and then, but not always for the Win7 installations affected. If I place a "msgbox()" just in front of the "run()" command, it seems never to show this "select your language" dialog. If I take out this MsgBox() the "select your language" dialog shows up sometimes. When I "ClipPut()" the run command prior the "Run()" and paste that one to a CMD box, then it seems to *NEVER* happen, that this "select your language" dialog shows up. "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" "\\pc0009\Y_DRV_H\Daten\TIF\08\32\G000110832_Freigegeben.idw.pdf" $AcroRead='"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"' $PDF='"Y:\Temp\DRV_H\Daten\TIF\33\85\153385_Freigegeben.dwg.pdf"' MsgBox(0,"Values",$AcroRead & @CRLF & $PDF,1) $MyCommand=$AcroRead & " " & $PDF ClipPut($MyCommand) Run($MyCommand) It looks like, that this "--channel=... --type=renderer" parameters are always fact for the AcroRd32.exe instance, that is opening the PDF to be displayed. The Instance opening the "PDF Display GUI" seems to always be a child process of another AcroRd32.exe process. Any clue, what's going on "backstage" here? How to avoid this "Choose your language" dialog? Or maybe someone can mention a different "portable" PDF viewer, I could use for this purpose? Any suggestions appreciated, regards, Rudi.
- 1 reply
-
- adobe reader
- run
-
(and 1 more)
Tagged with:
-
Hi, I have a software which has a 'run file'-ie; when i double click on that file, the input file of the software is run by the software. I wish to double click/execute this run file using autoit. how do i achieve this. i opened the software and it shows the input file and run file in same folder, i will put my autoitscript file too in same location. how do i simulate double clicking the run file (using its file name, say - abc.run ). I entered the following lines to make software window active - it became active, dont know how to go forward Winactivate("program title") winwaitactivate("program title") controlclick("program title","abc.run",1000,"primary",2) ; 1000 is ctrl id
- 2 replies
-
- third party software
- execute
-
(and 1 more)
Tagged with:
-
Initial Problem I've written several scripts with the following sequence: Execute a program using Run w/stdout+stderr captured Typically processes all the files in one directory tree to populate a second tree Execute a second program (also with Run) to monitor the products of the first program and Display a progress bar (percentage of output files complete) Also monitor the first program's process and exit when it terminates The script then calls ProcessWaitClose (no timeout) on the first program's process and Checks the first program's results Kills the monitor program if it hasn't already exited on its own. Sometimes, ProcessWaitClose returns 1 with @error = 0 and @extended = 0xCCCCCCCC (actually, 0xFFFFFFFFCCCCCCCC), which seems ambiguous: the documentation says that @error = non-zero and @extended = 0xCC... means an invalid PID (unclear what the return value is), and 1 is returned for non-existent processes (but no mention of @extended). The 1/0/0xCC... result seems to occur when the first program exits very quickly (with or without an error). Since the exit value is not available, the script scans the program's output and tries to determine whether it ran successfully. This has gotten complicated and unreliable. Partial Fix I've now implemented a much simpler approach that works for most cases: Modify the monitor program so that it ignores the other program's process (the monitor always gets killed by the script anyway) Execute the monitor program first using Run, then execute the processing program with RunWait When RunWait returns, the child process exit value is available, so the script can ignore its output (which isn't available anyway) If the monitor program is still running, kill it. Remaining Issue However, there are still a couple of cases where it's necessary to get both the exit value from the processing program and its output. Since RunWait doesn't capture stdout and stderr for the parent script, it's looking like I'll have to call RunWait and redirect the 2 streams to a temp file and then scan it. Also, to do the redirect, I think I'll have to use @ComSpec to execute the processing program, which adds an undesired layer. Does anybody have a better (cleaner) way to handle these cases?
-
Hi~ I have some question about how to enable the test mode via "Run" or "shellexecute" of command, was to tried : ----- Run("bcdedit.exe /-set testsinging on", "C:\Windows\System32") and shellexecute("bcdedit.exe /-set testsinging on", "C:\Windows\System32") ----- since this command must to run through administrator competence, have any method can accomplish it?
-
Hello all, I've written the code below which launches chrome in incognito mode and then proceeds to go to the autoit website. From my understanding, the Run() command is also supposed to output the PID number related to the application that got launched from the Run command. However when I run the below lines, it outputs a PID number that is different from the newly launched chrome browser's PID number, does anyone know why and possibly explain how I could retrieve the accurate PID number associated with the newly launched browser? Global $iPid = Run(@ComSpec & ' /c start chrome.exe https://www.autoitscript.com/forum/ -incognito' ,"", "") msgbox(0,"",$iPid) Thank you, Brian
-
I need help to understand why the run function does not work, but if i use it directly inside cmd shell the command works. $where is the name of the jpg file ShellExecute(@ComSpec ," /k C:\Users\root\Desktop\test\exiftool.exe -p $FileName "&'"'&$where&'"'&" > "&'"'&@ScriptDir&"\out.txt"&'"',@ScriptDir);<----- work Run("C:\Users\root\Desktop\test\exiftool.exe -p $FileName "&$where&" > "&@ScriptDir&"\out.txt",@ScriptDir);<--- doesn't work I would use the run command! Thx
-
Hello How are you I have a question, please. I've created a window and i need when i run the script if it detect an other copy from the same script was runing the script close the first copy Automatically and run a new copy I want an example to understand it
-
I am attempting to run an Autoit.exe with schtasks every weekday @ 9:05 am. I have the below C:\>SchTasks /Create /TN "P10Run" /TR "O:\AUTOIT\P40 Run.au3" /SC WEEKLY /D MON, TUE,WED,THU,FRI /ST 09:05:00 SUCCESS: The scheduled task "P10Run" has successfully been created. I also did a "test" run : C:\>Schtasks /Run /TN "P10Run SUCCESS: Attempted to run the scheduled task "P10Run". But when I run my query to verify success my "Last Result" seems to indicate that the script did not run: C:\>SCHTASKS /QUERY /FO LIST /V /TN "P10RUN" Folder: \ HostName: xxxxxxxxxxxxxxxx TaskName: \P10RUN Next Run Time: N/A Status: Could not start Logon Mode: Interactive only Last Run Time: 6/14/2017 9:08:56 AM Last Result: -2147024894 Author: xxxxxxx Task To Run: O:\AUTOIT\P40 Run.au3 Start In: N/A Comment: N/A Scheduled Task State: Enabled Idle Time: Disabled Power Management: Stop On Battery Mode, No Start On Batterie s Run As User: xxxxxxxxx\xxxxxxxx Delete Task If Not Rescheduled: Enabled Stop Task If Runs X Hours and X Mins: 72:00:00 Schedule: Scheduling data is not available in this f ormat. Schedule Type: Weekly Start Time: 9:05:00 AM Start Date: 6/14/2017 End Date: N/A Days: MON, TUE, WED, THU, FRI Months: Every 1 week(s) Repeat: Every: Disabled Repeat: Until: Time: Disabled Repeat: Until: Duration: Disabled Repeat: Stop If Still Running: Disabled C:\> Is there something missing in my command? Also is there a better way to make sure that the script does in fact sun successfully? Thanks In Advance!
-
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
- 25 replies
-
- ps1
- power shell
-
(and 3 more)
Tagged with:
-
Hello, What command would I use to open the following folder directories for: Computer/This PC (windows 7/Windows 10) Libraries\documents Libraries\Pictures I know: Run("Explorer.exe " & $filepath) ShellExecute($filepath) can be used to open folder locations when you type in the full directory such as "C:\Users\%username%\Documents" but I'm trying to figure out how to use these windows short paths. Thanks,
- 5 replies
-
- run
- shellexecute
-
(and 3 more)
Tagged with:
-
I'm attempting to code a Run or RunWait command that is a little on the long side and contains multiple sets of embedded quotes (as it would be issued from a CMD prompt), but can't for the life of me figure out the containing quotes as pertains to AutoIt. Here's the one-line command as it would be issued via a CMD prompt... "\\AppServ\G$\Connectivity\Clients\Citrix\Receiver\14.5.0.10018\CitrixReceiver.exe" ADDLOCAL="ReceiverInside,ICA_Client,WebHelper,SSON,AM,SELFSERVICE,USB,DesktopViewer,Flash,Vd3d" ALLOWADDSTORE=A ALLOWSAVEPWD=A ENABLEPRELAUNCH=Y ENABLE_SSON=Yes STORE0="AppStore;https://receiver.domain.net/Citrix/Apps/discovery;on;AppStore" /EnableCEIP=false /includeSSON /noreboot /silent I've tried so many different combinations of surrounding quotes with Run and RunWait, I just don't understand why it's this difficult to get past this. Can anyone assist with this? Thank you.
-
Hi guys, This is probably an obvious one, but I really don't use this command at all so am hoping you can spot my mistake. I'm running a powershell script on a schedule with the following script in a function, the function is being called in a loop, but the console process is not closing in the background and I end up with a bunch of console windows running in the background: Run(@comspec & ' /k PowerShell.exe -STA -NonInteractive -ExecutionPolicy ByPass -Command "& ''Z:\Powershell\365\GetNextDetails.ps1'' "', "", @SW_HIDE) Thanks!
-
Hi all. I am creating an app that runs a program with the admin privileges using the shellexecute's run as verb, but what my problem is, that no matter what I use to launch the program, it doesn't quite work like the run dialog would (certain programs don't get found, etc.). I've tried using the explorer.exe and passing the program to it, that is unreliable and opens documents folder sometimes instead, I've tried using the @comspec /c and that works better, but still some of the programs aren't being found that would be with the run dialog e.g., if I do @comspec /c diskpart it won't find it, I've even tried setting the working dir, but still no luck. I also tried passing commandline params to C:\WINDOWS\system32\rundll32.exe shell32.dll,#61, but no luck. can anyone help me what way to go in order to be able to launch programs in the run dialog style? is there a function in winapi that run dialog uses that I could use as well? Or what would be the best way to go about this? Any help much appreciated.
-
I have written a script to build the Installshield project file(.ism) to setup files(.msi or .exe based on the release settings..). So when the user runs the script the process will be automatic for multiple ism files. Func Build($sOutputIsm,$ReleaseName,$sFilePath="None",$NewName="None") ;build the ism to get the msi If not FileExists($sOutputIsm) Then Logging("File Not Found: $sOutputIsm$",4) MsgBox($MB_OK + $MB_ICONERROR, "Error", "Could not find file ""$sOutputIsm$"".") Return EndIf Logging("Started Building $sOutputIsm$",4) ShowTrayTip($AppName, "Started Building $sOutputIsm$", 10, $TIP_ICONASTERISK) Dim $sBuildExe,$sBuildCommand,$Ret $sBuildExe = FindFileInPath("ISCmdBld.exe", "%ProgramFiles(x86)%\InstallShield") $sBuildCommand = """$sBuildExe$"" -p ""$sOutputIsm$"" -r ""$ReleaseName$"" -s" ;MsgBox(0,"",$sBuildCommand) $Ret = RunWait($sBuildCommand) If $Ret <> 0 Then ShowTrayTip($AppName,"ISM Build Failed, Please build the ISM Manually.",10, $TIP_ICONHAND) MsgBox($MB_OK + $MB_ICONERROR, "Error", "Could not build ""$sOutputIsm$"". Please build manually.") Logging("Error $Ret$ while Building $sOutputIsm$",4) Return;Exit(1) Else ShowTrayTip($AppName,"ISM Build Completed",10, $TIP_ICONASTERISK) Logging("Completed Building $sOutputIsm$",4) if not StringCompare($NewName, "None")=0 then MoveEXE($sFilePath,$NewName) EndIf EndFunc The problem is when we run the ISCmdBuild.exe the RunWait will give whether fail or success but not what are the errors we got. If we use Run, it will give that logging but we don't have the feature of getting fail/success as RunWait. If we run the above code by removing -s and using redirection operator > to a file, it is running manually but failing with autoit. Like $sBuildCommand = """$sBuildExe$"" -p ""$sOutputIsm$"" -r ""$ReleaseName$"" > c:\logs\uday.log" Any help on this?? And also, in some machines the installshield shortcut is launching fine as licensed version but with ISCmdBld.exe it is giving error as licensing info missing or not registered. Any suggestion on this too??
- 15 replies
-
- installshield
- run
-
(and 2 more)
Tagged with:
-
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....
- 2 replies
-
- scheduled tasks
- cmd
-
(and 2 more)
Tagged with:
-
Hello, 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? Not working: 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)