Jump to content
WannaBeGut

While Runwait

Recommended Posts

WannaBeGut

Hello,

I just wrote a script that should copy data into my cloud using xcopy (cmd), but I want the Status Bar I have in my GUI to change it's text like that:

working. -> working.. -> working... -> working. ...

I would also like to make a button which interrupts xcopy (simply closing it should do the trick), but I don't know how to call ProcessClose("xcopy.exe") using a button, while I'am waiting for RunWait to finish.

Example:

$command = 'xcopy "' & @DesktopDir & '\text.txt"' & ' "\\ADMIN-CLOUD\private\" /EECHIY'
$SW_STATE = @SW_HIDE
RunWait(@ComSpec & " /c " & '"' & $command & '"', @DesktopDir, $SW_State)

Please tell me if you need any further information! :)

Edited by WannaBeGut

Share this post


Link to post
Share on other sites
tonycst

u cant do while runwait.

runwait=pause the script until what ever runs exits.

u need to:

$process = run ("command")
while 1
    if $process = 0 then exitloop
wend

 

  • Like 1

Share this post


Link to post
Share on other sites
WannaBeGut
1 hour ago, tonycst said:

u cant do while runwait.

runwait=pause the script until what ever runs exits.

u need to:

$process = run ("command")
while 1
    if $process = 0 then exitloop
wend

 

If I start cmd using Run it wont copy data, it will close instantly (the xcopy syntax is alright)

I need a verification that the script is still runnning and copying (in the program not the task manager or sth. like that)

Edited by WannaBeGut

Share this post


Link to post
Share on other sites
argumentum

Show me yours ( the working script )
and I'll show you mine ( fixed script ).

2 hours ago, WannaBeGut said:

...but I want the Status Bar I have in my GUI to change...

so .... where is it ?

Share this post


Link to post
Share on other sites
markyrocks

ya that does look a lil wicked , this is the best i can do for you, well for now anyway

#include <GUIConstantsEx.au3>
$command = 'xcopy "' & @DesktopDir & '\text.txt"' & ' "\\ADMIN-CLOUD\private\" /EECHIY'
$SW_STATE = @SW_HIDE
RunWait(@ComSpec & " /c " & '"' & $command & '"', @DesktopDir, $SW_State)
AdlibRegister("_CheckState",1000)


func _CheckState()
if ProcessExists("process.exe") Then
    _Working()
Else
    AdlibUnRegister("_CheckState")
EndIf
    EndFunc



func _Working()
    $hGui=GUICreate("Stuff is happening",100,100,0,0)
    $handle=WinGetHandle("Stuff is happening")
    GUISetState(@SW_SHOW,$handle)
    GUICtrlCreateLabel("working,..",0,50)
    $cancel=GUICtrlCreateButton("Cancel",0,75)

$process=ProcessExists("process.exe")
While $process<>0
    $process=ProcessExists("process.exe")
    if $process=0 Then
        ExitLoop
    EndIf

        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $cancel
                _Cancel()
                ExitLoop
        EndSwitch
    WEnd
EndFunc


Func _Cancel()

    MsgBox("","","you pressed cancel")

    if ProcessExists("process.exe") Then
        ProcessClose("process.exe")
    Else
        MsgBox("","error","process.exe doesn't exist")
        EndIf


    EndFunc

 

Edited by markyrocks
  • Like 1

Share this post


Link to post
Share on other sites
WannaBeGut
#RequireAdmin
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>

#Region GUI START

$window_main = GUICreate("Backup", 418, 397, 340, 327)
$input_documents = GUICtrlCreateInput("", 104, 24, 241, 21)
$input_pictures = GUICtrlCreateInput("", 104, 56, 241, 21)
$input_videos = GUICtrlCreateInput("", 104, 88, 241, 21)
$input_music = GUICtrlCreateInput("", 104, 120, 241, 21)
$input_emails = GUICtrlCreateInput("", 104, 152, 241, 21)
$input_destination = GUICtrlCreateInput("", 104, 184, 241, 21)
$label_documents = GUICtrlCreateLabel("Documents:", 24, 24, 61, 17)
$label_pictures = GUICtrlCreateLabel("Pictures:", 24, 56, 45, 17)
$label_videos = GUICtrlCreateLabel("Videos:", 24, 88, 39, 17)
$label_music = GUICtrlCreateLabel("Music:", 24, 120, 35, 17)
$label_emails = GUICtrlCreateLabel("E-Mails:", 24, 152, 41, 17)
$label_destination = GUICtrlCreateLabel("Destination:", 24, 184, 60, 17)
$button_documents = GUICtrlCreateButton("...", 352, 24, 35, 23)
$button_pictures = GUICtrlCreateButton("...", 352, 56, 35, 25)
$button_videos = GUICtrlCreateButton("...", 352, 88, 35, 25)
$button_music = GUICtrlCreateButton("...", 352, 120, 35, 25)
$button_emails = GUICtrlCreateButton("...", 352, 152, 35, 25)
$button_destination = GUICtrlCreateButton("...", 352, 184, 35, 25)
$button_saveini = GUICtrlCreateButton("Save Settings to INI", 24, 336, 180, 25)
;$button_cancel = GUICtrlCreateButton("Cancel", 152, 336, 115, 25)
$button_start = GUICtrlCreateButton("Start", 215, 336, 180, 25)
$checkbox_documents = GUICtrlCreateCheckbox("Copy Documents", 40, 256, 97, 17)
$checkbox_pictures = GUICtrlCreateCheckbox("Copy Pictures", 144, 256, 81, 17)
$checkbox_videos = GUICtrlCreateCheckbox("Copy Videos", 240, 256, 81, 17)
$checkbox_music = GUICtrlCreateCheckbox("Copy Music", 40, 288, 73, 17)
$checkbox_emails = GUICtrlCreateCheckbox("Copy E-Mails", 144, 288, 81, 17)
$group_settings = GUICtrlCreateGroup("Turn on / off", 24, 224, 369, 97)
$checkbox_eabuffer = GUICtrlCreateCheckbox("Copy without E/A - Buffer", 240, 288, 145, 17)
$statusbar = _GUICtrlStatusBar_Create($window_main)
_GUICtrlStatusBar_SetText($statusbar, "Status: Waiting...")
GUISetState(@SW_SHOW)

#EndRegion GUI END

If FileExists(@ScriptDir & "\settings.ini") Then
    GUICtrlSetData($input_documents, IniRead(@ScriptDir & "\settings.ini", "Directories", "dir_documents", ""))
    GUICtrlSetData($input_pictures, IniRead(@ScriptDir & "\settings.ini", "Directories", "dir_pictures", ""))
    GUICtrlSetData($input_videos, IniRead(@ScriptDir & "\settings.ini", "Directories", "dir_videos", ""))
    GUICtrlSetData($input_music, IniRead(@ScriptDir & "\settings.ini", "Directories", "dir_music", ""))
    GUICtrlSetData($input_emails, IniRead(@ScriptDir & "\settings.ini", "Directories", "dir_emails", ""))
    GUICtrlSetData($input_destination, IniRead(@ScriptDir & "\settings.ini", "Directories", "dir_destination", ""))
EndIf

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $button_documents
            $dir_documents = FileSelectFolder("Select your documents folder...", "")
            GUICtrlSetData($input_documents, $dir_documents)
        Case $button_pictures
            $dir_pictures = FileSelectFolder("Select your pictures folder...", "")
            GUICtrlSetData($input_pictures, $dir_pictures)
        Case $button_videos
            $dir_videos = FileSelectFolder("Select your videos folder...", "")
            GUICtrlSetData($input_videos, $dir_videos)
        Case $button_music
            $dir_music = FileSelectFolder("Select your music folder...", "")
            GUICtrlSetData($input_music, $dir_music)
        Case $button_emails
            $dir_emails = FileSelectFolder("Select your e-mail folder...", "")
            GUICtrlSetData($input_emails, $dir_emails)
        Case $button_destination
            $dir_destination = FileSelectFolder("Select the folder your files should be saved in...", "")
            GUICtrlSetData($input_destination, $dir_destination)
        Case $button_saveini
            IniWrite(@ScriptDir & "\settings.ini", "Directories", "dir_documents", GUICtrlRead($input_documents))
            IniWrite(@ScriptDir & "\settings.ini", "Directories", "dir_pictures", GUICtrlRead($input_pictures))
            IniWrite(@ScriptDir & "\settings.ini", "Directories", "dir_videos", GUICtrlRead($input_videos))
            IniWrite(@ScriptDir & "\settings.ini", "Directories", "dir_music", GUICtrlRead($input_music))
            IniWrite(@ScriptDir & "\settings.ini", "Directories", "dir_emails", GUICtrlRead($input_emails))
            IniWrite(@ScriptDir & "\settings.ini", "Directories", "dir_destination", GUICtrlRead($input_destination))
        Case $button_start
            _backup(GUICtrlRead($input_documents), GUICtrlRead($input_pictures), GUICtrlRead($input_videos), GUICtrlRead($input_music), GUICtrlRead($input_emails), GUICtrlRead($input_destination), GUICtrlRead($checkbox_documents), GUICtrlRead($checkbox_pictures), GUICtrlRead($checkbox_videos), GUICtrlRead($checkbox_music), GUICtrlRead($checkbox_emails), GUICtrlRead($checkbox_eabuffer))
    EndSwitch
WEnd

Func _backup($documents, $pictures, $videos, $music, $emails, $destination, $cs_documents, $cs_pictures, $cs_videos, $cs_music, $cs_emails, $cs_eabuffer)

    $hTime = TimerInit()
    Local $aTimes

    _GUICtrlStatusBar_SetText($statusbar, "Status: Copying...")
    GUICtrlSetState($button_documents, 128)
    GUICtrlSetState($button_pictures, 128)
    GUICtrlSetState($button_videos, 128)
    GUICtrlSetState($button_music, 128)
    GUICtrlSetState($button_emails, 128)
    GUICtrlSetState($button_destination, 128)
    GUICtrlSetState($button_start, 128)
    GUICtrlSetState($button_saveini, 128)
    If Not FileExists($destination) Then DirCreate($destination)
    If $cs_eabuffer = 1 Then $options = "/ECHIY /J"
    If $cs_eabuffer = 4 Then $options = "/ECHIY"
    If $cs_documents = 1 Then
        _GUICtrlStatusBar_SetText($statusbar, "Status: Copying documents...")
        _cmd('xcopy "' & $documents & '" "' & $destination & '\Documents_' & @MDAY & '_' & @MON & '_' & @YEAR & '" '  & $options, 0)
    EndIf
    If $cs_pictures = 1 Then
        _GUICtrlStatusBar_SetText($statusbar, "Status: Copying pictures...")
        _cmd('xcopy "' & $pictures & '" "' & $destination & '\Pictures_' & @MDAY & '_' & @MON & '_' & @YEAR & '" '  & $options, 0)
    EndIf
    If $cs_videos = 1 Then
        _GUICtrlStatusBar_SetText($statusbar, "Status: Copying videos...")
        _cmd('xcopy "' & $videos & '" "' & $destination & '\Videos_' & @MDAY & '_' & @MON & '_' & @YEAR & '" '  & $options, 0)
    EndIf
    If $cs_music = 1 Then
        _GUICtrlStatusBar_SetText($statusbar, "Status: Copying music...")
        _cmd('xcopy "' & $music & '" "' & $destination & '\Music_' & @MDAY & '_' & @MON & '_' & @YEAR & '" '  & $options, 0)
    Endif
    If $cs_emails = 1 Then
        _GUICtrlStatusBar_SetText($statusbar, "Status: Copying emails...")
        _cmd('xcopy "' & $emails & '" "' & $destination & '\emails_' & @MDAY & '_' & @MON & '_' & @YEAR & '" '  & $options, 0)
    EndIf
    If @error = 0 Then
        MsgBox(0, "  Done...", " Finished copying data!")
        _GUICtrlStatusBar_SetText($statusbar, "Status: Success!")
    Else
        MsgBox(16, "  Error...", "An error occurred -> " & @error)
        _GUICtrlStatusBar_SetText($statusbar, "Status: Error: " & @error)
    EndIf
    GUICtrlSetState($button_documents, 64)
    GUICtrlSetState($button_pictures, 64)
    GUICtrlSetState($button_videos, 64)
    GUICtrlSetState($button_music, 64)
    GUICtrlSetState($button_emails, 64)
    GUICtrlSetState($button_destination, 64)
    GUICtrlSetState($button_start, 64)
    GUICtrlSetState($button_saveini, 64)
EndFunc

Func _cmd($command, $SW_State_Input)
    If $SW_State_Input = 0 Then $SW_State = @SW_HIDE
    If $SW_State_Input = 1 Then $SW_State = @SW_SHOW
    If $SW_State_Input = 2 Then $SW_State = @SW_MAXIMIZE
    If $SW_State_Input = 3 Then $SW_State = @SW_MINIMIZE
    If $SW_State_Input = 4 Then $SW_State = @SW_SHOWDEFAULT
    If $SW_State_Input = 5 Then $SW_State = @SW_SHOWMAXIMIZED
    If $SW_State_Input = 6 Then $SW_State = @SW_SHOWMINIMIZED
    If $SW_State_Input = 7 Then $SW_State = @SW_SHOWMINNOACTIVE
    $CMD = RunWait(@ComSpec & " /c " & '"' & $command & '"', @DesktopDir, $SW_State)
        If @Error = 0 Then
            Return $CMD
        Else
            Return @Error
        EndIf
EndFunc

That'st the full script.

Edited by WannaBeGut

Share this post


Link to post
Share on other sites
argumentum
1 minute ago, WannaBeGut said:

That'st he full script.

That's too much, I'll show you based on the prior script, ...in a few minutes 

Share this post


Link to post
Share on other sites
argumentum
#include <GUIConstantsEx.au3>
$command = 'xcopy "' & @DesktopDir & '\text.txt"' & ' "\\ADMIN-CLOUD\private\" /EECHIY'
$SW_STATE = @SW_HIDE

$hGui = GUICreate("Stuff is happening", 100, 100, 0, 0)
$handle = WinGetHandle("Stuff is happening")
GUISetState(@SW_SHOW, $handle)
GUICtrlCreateLabel("working,..", 0, 50)
$cancel = GUICtrlCreateButton("Cancel", 0, 75)
Global $i_PID = Run(@ComSpec & " /c " & $command , @DesktopDir, $SW_STATE) ; careful here, all those """"""
Global $SEC = @SEC
While 1
    If $SEC <> @SEC Then ; to ease up on the CPU, check every sec.
        $SEC = @SEC
        If Not ProcessExists($i_PID) Then ExitLoop
    EndIf

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $cancel; ,$GUI_EVENT_CLOSE <--- should go here ?
            Do
                ProcessClose($i_PID)
                Sleep(200)
            Until Not ProcessExists($i_PID)
            ExitLoop
    EndSwitch
WEnd

That criteria should be functional.

Edited by argumentum
tweak the code
  • Like 1

Share this post


Link to post
Share on other sites
WannaBeGut
6 minutes ago, argumentum said:

That's too much, I'll show you based on the prior script, ...in a few minutes 

It works, thanks alot ! :-)

  • Like 1

Share this post


Link to post
Share on other sites
markyrocks

i edited my last post bc i think the op's issue is stuff happening during the runwait.  I think the only way to make that happen is to use adlibregister?

 

 

edit.  i edited again to fix a typo but ya im just posting examples not meant the be all end all.  im just board,  don't have a program in the works so i just trying to help someone if i can.   plus its good exercise

Edited by markyrocks

Share this post


Link to post
Share on other sites
WannaBeGut
22 minutes ago, markyrocks said:

i edited my last post bc i think the op's issue is stuff happening during the runwait.  I think the only way to make that happen is to use adlibregister?

I really appreciate it ! :D

Share this post


Link to post
Share on other sites
markyrocks
6 minutes ago, WannaBeGut said:

I really appreciate it ! :D

no sweat.  Upon further review, I would adlibunregister the checkstate function after the working function starts but dammit now that im thinking about this the program could possibly pause forever in my above scenario......

Edited by markyrocks

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • dadalt95
      By dadalt95
      Hi!
      I want to get the signal in this website:
      https://binary-signal.com/pt/chart/eurusd
      I have tried using _IEBodyReadText  and some _StringBetween. What happens is that the text are being update every tick and _IEBodyReadText doesn't.
      To perform the update I used  _IEAction($oIE, "refresh") but it's not good because the website block me after some time due too many requests..
      Is there any other way to get this text every tick?
      PS: The text I want to get is WAIT, CALL or PUT.
       
      Here is the code:
      global $oIE = _IECreate ('https://binary-signal.com/pt/chart/eurusd', 0, 1 , 1 , 0) Local $sText = _IEBodyReadText($oIE) $result = _StringBetween ( $sText , 'PUTEUR/USD on Binary-signal.com', 'sinal está PRONTA') ;MsgBox ( 0, "asf", $result[0]) $espera=StringInStr($result[0], "WAIT") $compra=StringInStr($result[0], "CALL") $venda=StringInStr($result[0], "PUT") ;MsgBox($MB_SYSTEMMODAL, "", $espera) $n=0 $c=0 Captar() Func Captar() ;_IENavigate($oIE, "https://binary-signal.com/pt/chart/eurusd") ;MsgBox($MB_SYSTEMMODAL, "", $n) Local $sText = _IEBodyReadText($oIE) $result = _StringBetween ( $sText , 'PUTEUR/USD on Binary-signal.com', 'sinal está PRONTA') If (Not $compra=0) And $n=0 Then MsgBox($MB_SYSTEMMODAL, "", "COMPRE") $n=1 $c=$c+1 ;_IEAction($oIE, "refresh") Sleep(60000) Captar() ElseIf (Not $venda=0) And $n=0 Then MsgBox($MB_SYSTEMMODAL, "", "VENDA") $c=$c+1 $n=1 ;_IEAction($oIE, "refresh") ;MsgBox($MB_SYSTEMMODAL, "", $n) Sleep(60000) Captar() ElseIf (Not $venda=0) And $n=1 Then ;MsgBox($MB_SYSTEMMODAL, "", "Esperando próxima rodada") $n=1 ;MsgBox($MB_SYSTEMMODAL, "", $n) ;_IEAction($oIE, "refresh") Sleep(60000) Captar() ElseIf (Not $venda=0) And $n=1 Then ;MsgBox($MB_SYSTEMMODAL, "", "Esperando próxima rodada") $n=1 ;MsgBox($MB_SYSTEMMODAL, "", $n) ;_IEAction($oIE, "refresh") Sleep(60000) Captar() Else ;MsgBox("", "", "ESPERE") $n=0 Sleep(1000) ;_IEAction($oIE, "refresh") Local $sText = _IEBodyReadText($oIE) $result = _StringBetween ( $sText , 'PUTEUR/USD on Binary-signal.com', 'sinal está PRONTA') Captar() EndIf EndFunc  
    • nacerbaaziz
      By nacerbaaziz
      Hi dear
      With this script you can print Unicode text in the CMD screen
      the script is  easy to use
      just you  write the text that contains Unicode in the first input
      and the script automatically reflect the code in the second input
       you can copy the text to the clipboard
      or you can try printing the text in the CMD window
      I apologize to everyone for colors and shape if not appropriate
      I'm a blind man and I do not see
      Thank you for your understanding
      Greetings to all of youCmdUtM.au3
    • AndyS19
      By AndyS19
      I want to copy just the selected text in an input control and put it to the clipboard, but GuiCtrlRead() always reads all of the text in the control.
      In this test code, when I highlight a  portion of the left control's text and press ^C, I want to copy just that text to the clipboard; but when I highlight a  portion of the right control's text and press ^C, I want to copy all of its text to the clipboard.
      #include <Debug.au3> _DebugSetup(@ScriptName & "_debug.txt", False, 2, "") _DebugOut("=============== " & @MON & "/" & @MDAY & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & " ====================") #include <GUIConstants.au3> #include <WinAPI.au3> #include <Array.au3> Opt("GUICloseOnESC", 1) ; ESC closes GUI? (0 = no, 1 = yes) Opt("GUIOnEventMode", 1) ; Set OnEvent mode Opt('MustDeclareVars', 1) OnAutoItExitRegister("Event_GUIClose") Opt("GUIEventOptions", 1) ;0=default, 1=just notification, 2=GuiCtrlRead tab index Opt("WinTitleMatchMode", -2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Global $hWnd_MainWin, $iID_Left, $iID_Right _Main() Func _Main() $hWnd_MainWin = GUICreate("test7", 200, 300) $iID_Left = GUICtrlCreateInput("AAA BBB CCC (get Selected text)", 10, 30, 200, 25) GUICtrlSetOnEvent($iID_Left, "handle_left_btn") $iID_Right = GUICtrlCreateInput("DDD EEE FFF (get All text)", 10, 60, 200, 25) GUICtrlSetOnEvent($iID_Right, "handle_right_btn") Local $aAccelKeys[1][2] = [["^c", $hWnd_MainWin]] GUISetAccelerators($aAccelKeys) GUISetOnEvent($GUI_EVENT_CLOSE, 'Event_GUIClose') GUISetState() ; Make everything visible While 1 Sleep(127) WEnd EndFunc ;==>_Main Func handle_CTRL_C_key() ConsoleWrite("+++: handle_CTRL_C_key() entered" & @CRLF) Local $hCtrl, $ctrlID, $control_classname, $text $control_classname = ControlGetFocus($hWnd_MainWin) $hCtrl = ControlGetHandle($hWnd_MainWin, "", $control_classname) $ctrlID = _WinAPI_GetDlgCtrlID($hCtrl) If ($ctrlID = $iID_Left) Then $text = GUICtrlRead($ctrlID) ClipPut($text) ConsoleWrite("+++: Copied selected text:" & @CRLF & "==>" & $text & "<==" & @CRLF) ElseIf ($ctrlID = $iID_Right) Then $text = GUICtrlRead($ctrlID) ClipPut($text) ConsoleWrite("+++: Copied all text:" & @CRLF & "==>" & $text & "<==" & @CRLF) EndIf EndFunc ;==>handle_CTRL_C_key Func Event_GUIClose() Exit (99) EndFunc ;==>Event_GUIClose Func handle_left_btn() ConsoleWrite("+++: handle_left_btn() entered" & @CRLF) EndFunc ;==>handle_left_btn Func handle_right_btn() ConsoleWrite("+++: handle_right_btn() entered" & @CRLF) EndFunc ;==>handle_right_btn
       
    • vyperhand
      By vyperhand
      I'm struggling to launch a VBS file via autoit using RunWait.  Due to the nature of the deployment tool I am using for said script, I only know that the .vbs files will be in the same directory as my AutoIt-generated .exe, but not what that path will be.  The path will look something like this:
      c:\programdata\vendor\lots\of\folders\randomnumber
      This is generated during deployment and I have no way of predicting the path - therefore, I am not sure how to call back to "same directory" in order to successfully launch the .vbs.
      This line is as close as I have gotten - this fires off the cmd window, but it closes immediately with out information, and the .vbs is not launched.
      RunWait (@ComSpec & " /c" & 'cscript.exe WORKPLEASE.vbs ALL /Q /NoCancel') I thought /c might be the problem, but leaving out the /c element causes me not to even see the momentary CMD window flash by.  Any help will be greatly appreciated, and thanks in advance.
    • lewisg
      By lewisg
      Suddenly a RunWait command has stop working after 2 years of no errors, issues, or problems. The code uses RunWait to start Plink.exe, a command-line remote connection tool similar to UNIX ssh. I'm using it to ssh to a linux (Centos) machine, run a Perl script, and redirect the output to a file on a PC running the AutoIt script.  
       
      $FilePath = "C:\AutoIT\LED" $FilePathPlus = $FilePath & "\plink.exe" $Code1 = RunWait(@ComSpec & " /c " & $FilePathPlus & " -ssh -l root -pw ?????? 10.170.4.163 /usr/local/nagios/etc/led.pl > C:\AutoIT\LED\led.txt ", @SW_SHOW) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : @ComSpec & " /c " & $FilePathPlus & " -ssh -l root -pw ????? 10.170.4.163 /usr/local/nagios/etc/led.pl > C:\AutoIT\LED\led.txt " = ' & @ComSpec & " /c " & $FilePathPlus & " -ssh -l root -pw ?????? 10.170.4.163 /usr/local/nagios/etc/led.pl > C:\AutoIT\LED\led.txt " & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console The ConsoleWrite output when cut-n-pasted into a DOS box produces the expected file so I know it works. I've also tried many variations of the function moving, adding, and changing the " and ' (quote) marks. Also tried it without the @ComSpec macro and other related functions...e.g.  ShellExecuteWait , etc.
      The PC is a Windows 10 64bit and AutoIT is version 3.3.14.2.
      Searching here and Google has not yielded any clues that helped. 
×