
Stunt
Active Members-
Posts
23 -
Joined
-
Last visited
Everything posted by Stunt
-
Run command and using double quotes
Stunt replied to Stunt's topic in AutoIt General Help and Support
Thank you the above works like a charm -
Hi Guys, I am trying to run a command line app UbeCommander and output its display to a log file. My problem is to tdo that I have to use double quotes to get it to run, however when doing that though autoit I get syntax errors. Can anyone help? $PID = Run("C:\AutoDeploy\UBECommander.exe "autodep R9621 WAP0001" >> c:\autodeploy\autolog.txt")
-
Writing Date and Time Stamp to file
Stunt replied to Stunt's topic in AutoIt General Help and Support
No worries got it, _FileWriteLog will work great for me. Thanks guys -
Writing Date and Time Stamp to file
Stunt replied to Stunt's topic in AutoIt General Help and Support
Thanks, can you maybe tell me how to incluse that in the FileWrite program as that only seems to be able to accept text? -
Hi Guys, Can anyone assist me with writing date and time stamp to a file through the FileWrite command?
-
stupid stupid stunt , thanks dude.
-
Hi Guys, Cant get this to run through all the steps, any ideas. I have tried with a Do and a for but no luck. Do $n=0 ControlSend($JASWind, "", "", "{TAB}") Sleep(5000) If $n = 5 Then Sleep(5000) ControlSend($JASWind, "", "", "\\shjdedp01\B7334\PY7334\PACKAGE\AUTODEPLOY\work\GeneratorList.txt") Else If $n = 12 Then Sleep(5000) ControlSend($JASWind, "", "", "ENTER") Else If $n = 13 Then Sleep(5000) ControlSend($JASWind, "", "", "{ALTDOWN}f{ALTUP}b{ENTER}") EndIf $n=$n+1 Until $n=13
-
Selecting an Item on existing a list box
Stunt replied to Stunt's topic in AutoIt GUI Help and Support
Ok well then back to my ssh I suppose. I have this script which executes ssh.exe, it runs fine if I am logged in but not if I am logged off and it does not have any GUI interface? [ autoit];Removes Package Directory from the Enterprise Server Run("C:\Program Files\OpenSSH\bin\ssh -l jde 10.56.154.10") WinWait("C:\Program Files\OpenSSH\bin\ssh.exe") $sshWind = WinGetHandle("C:\Program Files\OpenSSH\bin\ssh.exe") ControlSend($sshWind, "", "", "1029{ENTER}") ControlSend($sshWind, "", "", "rm -R /u03/jdedwardsoneworld/b7334/packages/AUTODEPLOY{ENTER}") ControlSend($sshWind, "", "", "exit{ENTER}")[ /autoit] -
Selecting an Item on existing a list box
Stunt replied to Stunt's topic in AutoIt GUI Help and Support
Hi There, Script still hangs if I am logged off, I am back to where I started when trying to get the ssh to run while being logged off. Is it actually possible to run Autoit while being logged off, cause it seems to work fine if you logged on but not the other way around? -
Selecting an Item on existing a list box
Stunt replied to Stunt's topic in AutoIt GUI Help and Support
Hi There, Script still hangs if I am logged off, I am back to where I started when trying to get the ssh to run while being logged off. Is it actually possible to run Autoit while being logged off, cause it seems to work fine if you logged on but not the other way around? -
Selecting an Item on existing a list box
Stunt replied to Stunt's topic in AutoIt GUI Help and Support
Thanks for the help. Will readup in the help file. Stunt -
Selecting an Item on existing a list box
Stunt replied to Stunt's topic in AutoIt GUI Help and Support
My copy paste didnt work to well, missed some lines... I see your change now and have added the EndIf. Could you maybe explain what the included header and your additional lines do, sorry but this is a bit over my head. I am testing it now. Regards, Stunt -
Selecting an Item on existing a list box
Stunt replied to Stunt's topic in AutoIt GUI Help and Support
Hi, I see you removed line 63 from the code? $btnExit = GuiCtrlCreateButton("&Exit", 155, 340, 70, 25) Im not 100% sure what that line did, but with it removed the progrem does not launch? Can you explain? Regards, Stunt -
Selecting an Item on existing a list box
Stunt replied to Stunt's topic in AutoIt GUI Help and Support
File Attached. Sorry didnt know about the [ autoit][ /autoit], looking at it some more, even if we could get the script to autoselect my server in the ini file and run it without and interation from me would be best - but im still quite new and this is a bit over my head... Thanks for coming back to me. Stunt Cant seem to upload files, it is below. My file name is UnixCmd.ini: [General] Putty=C:\AutoDeploy\putty.exe [szaordv1] IP=10.56.154.10 User=jde Pwd=D1501DA3A043DDFF5FC7C3EC1DE108003FA2 sleep=3000 SendKeyDelay=100 Cmd1=rm -R /u03/jdedwardsoneworld/b7334/packages/AUTODEPLOY{ENTER} Cmd2=exit{ENTER} -
Hi All, I have a script which creates a listbox, I am trying to automate selecting an item of that list box. But cant seen to get focus on it or controlsend to it, or maybe thats not the way to do it. Have had a look at some of the _GUI commands but they loose me. Can anyone help PLEEEEASE? Here is the script that creates the listbox: #Region Compiler directives section ;** This is a list of compiler directives used by CompileAU3.exe. ;** comment the lines you don't need or else it will override the default settings ;#Compiler_Prompt=y ;y=show compile menu ;** AUT2EXE settings ;#Compiler_AUT2EXE= ;#Compiler_Icon=Wizard.ico ;Filename of the Ico file to use ;#Compiler_OutFile= ;Target exe filename. #Compiler_Compression=4 ;Compression parameter 0-4 0=Low 2=normal 4=High #Compiler_Allow_Decompile=y ;y= allow decompile ;#Compiler_PassPhrase= ;Password to use for compilation ;** Target program Resource info #Compiler_Res_Comment=Unix Shell Management #Compiler_Res_Description=Unix Shell Management #Compiler_Res_Fileversion=1.2 #Compiler_Res_LegalCopyright=Giuseppe Criaco ; free form resource fields ... max 15 #Compiler_Res_Field=Email|gcriaco@sogei.it ;Free format fieldname|fieldvalue #Compiler_Res_Field=Release Date|1/25/2006 ;Free format fieldname|fieldvalue ;#Compiler_Res_Field=Name|Value ;Free format fieldname|fieldvalue ;#Compiler_Res_Field=Name|Value ;Free format fieldname|fieldvalue #Compiler_Run_AU3Check=y ;Run au3check before compilation ; The following directives can contain: ; %in% , %out%, %icon% which will be replaced by the fullpath\filename. ; %scriptdir% same as @ScriptDir and %scriptfile% = filename without extension. #Compiler_Run_Before= ;process to run before compilation - you can have multiple records that will be processed in sequence #Compiler_Run_After=move "%out%" "%scriptdir%" ;process to run After compilation - you can have multiple records that will be processed in sequence #EndRegion ;=================================================================================================== ================================================ ; ; Program Name: UnixCmd() ; Description: Unix Shell Management ; Parameter(s): None ; Requirement(s): UnixCmd.ini, PuTTY Executable ; Return Value(s): None ; Author(s): Giuseppe Criaco <gcriaco@quipo.it> ; ;=================================================================================================== ================================================ ; #Region - Include and Declarations AutoItSetOption("TrayIconDebug", 1) ;Debug: 0=no info, 1=debug line info #include <string.au3> #include <GuiConstants.au3> Global Const $WM_COMMAND = 0x0111 Global Const $LBN_SELCHANGE = 1 Global Const $LBN_DBLCLK = 2 Dim $asCmd[50], $iCmd = 0, $ip, $sHostName, $sEncryptPwd, $sPwd, $sUser, $iSleep = 1000, $sPutty, $iSendKeyDelay = 50 #EndRegion - Include and Declarations #Region - GUI objects creation GuiCreate("UnixCmd v. 1.2", 235, 375,(@DesktopWidth-325)/2, (@DesktopHeight-285)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GUICtrlCreateLabel("Server List:", 10, 10, 135, 30) $lstServer = GuiCtrlCreateList("", 10, 30, 215, 310) $btnOk = GuiCtrlCreateButton("&Start", 75, 340, 70, 25, $BS_DEFPUSHBUTTON ) $btnExit = GuiCtrlCreateButton("&Exit", 155, 340, 70, 25) HotKeySet("{ESC}", "_Terminate") #EndRegion - GUI objects creation #Region Management If (Not FileExists(@ScriptDir & "\UnixCmd.ini")) Then #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Warning MsgBox(48, "File Not Found", "Required file not found (" & @ScriptDir & "\UnixCmd.ini" & ")" & @CRLF & "" & @CRLF & "UnixCmd will now exit!!!") #EndRegion --- CodeWizard generated code End --- Exit EndIf ;General Options $sSection = IniReadSection(@ScriptDir & "\UnixCmd.ini", "General") If @error Then #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Critical MsgBox(16,"UnixCmd","Unable to read the section General") #EndRegion --- CodeWizard generated code End --- Exit Else ;Read Loop on the Section For $iSection = 1 To $sSection[0][0] Select Case $sSection[$iSection][0] = "Putty" $sPutty = $sSection[$iSection][1] EndSelect Next EndIf $var = IniReadSectionNames(@ScriptDir & "\UnixCmd.ini") If @error Then MsgBox(4096, "", "Error occured, probably no INI file.") Else ;Load ListBox For $i = 1 To $var[0] if $var[$i] <> "General" Then GUICtrlSetData($lstServer,$var[$i]) Next EndIf ; create the symmetric decryption key $sSymmetricKey = _StringToHex ("wef,5RDx") ;Register a user defined function for the Windows Message ID WM_COMMAND. GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $btnExit _Terminate() Case $msg = $btnOk _Start() EndSelect WEnd ;=============================================================================== ; Function Name: _StartPuTTY($sIP) ; Description: Start a Telnet session by PuTTY ; Parameter(s): None ; Requirement(s): None ; Return Value(s): None ; Author(s): Giuseppe Criaco <gcriaco@quipo.it> ;=============================================================================== Func _StartPuTTY($sIP) Run(Chr(34) & $sPutty & Chr(34) & " -load " & Chr(34) & $sHostName & Chr(34)) WinWait($sIP & " - PuTTY", "") If Not WinActive($sIP & " - PuTTY","") Then WinActivate($sIP & " - PuTTY","") WinWaitActive($sIP & " - PuTTY","") Sleep($iSleep) EndFunc ;==>_StartPuTTY Func _Terminate() Exit 0 EndFunc ;=============================================================================== ; Function Name: _Start() ; Description: None ; Parameter(s): None ; Requirement(s): None ; Return Value(s): None ; Author(s): Giuseppe Criaco <gcriaco@quipo.it> ;=============================================================================== Func _Start() $sHostName = GUICtrlRead($lstServer) $sSection = IniReadSection(@ScriptDir & "\UnixCmd.ini", $sHostName) If @error Then #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Critical MsgBox(16,"UnixCmd","Unable to read the section " & $sHostName) #EndRegion --- CodeWizard generated code End --- Exit Else ;Read Loop on the Section For $iSection = 1 To $sSection[0][0] Select Case $sSection[$iSection][0] = "IP" $sIP = $sSection[$iSection][1] Case $sSection[$iSection][0] = "User" $sUser = $sSection[$iSection][1] Case $sSection[$iSection][0] = "Pwd" $sEncryptPwd = $sSection[$iSection][1] ;Decrypt user password $sPwd = _StringEncrypt(0,$sEncryptPwd,_StringToHex ("wef,5RDx")) If @error = 1 Then #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Critical MsgBox(16,"UnixCmd","_StringEncrypt of " & $sEncryptPwd & " Failed") #EndRegion --- CodeWizard generated code End --- Exit EndIf Case $sSection[$iSection][0] = "SendKeyDelay" $iSendKeyDelay = $sSection[$iSection][1] Case $sSection[$iSection][0] = "Sleep" $iSleep = $sSection[$iSection][1] Case Else If StringLeft ($sSection[$iSection][0], 1) <> "#" Then $sCmdTmp = $sSection[$iSection][1] If StringIsXDigit($sCmdTmp) Then ;returns 1 ;Decrypt Item $asCmd[$iCmd] = _StringEncrypt(0,$sCmdTmp,_StringToHex ("wef,5RDx")) If @error = 1 Then ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Critical MsgBox(16,"UnixCmd","_StringEncrypt of " & $sCmdTmp & " Failed") Exit EndIf Else $asCmd[$iCmd] = $sCmdTmp EndIf $iCmd = $iCmd + 1 EndIf EndSelect Next BlockInput(1) ;Start a PuTTY Telnet/SSH Session _StartPuTTY($sIP) AutoItSetOption("SendKeyDelay", $iSendKeyDelay) ;Login to the server ControlSend ($sIP & " - PuTTY", "", "", $sUser & "{ENTER}") ControlSend ($sIP & " - PuTTY", "", "", $sPwd & "{ENTER}") ; Executes commands listed under the INI Section If $iCmd > 0 Then $iTotItems = $iCmd -1 $iCmd = 0 For $iCmd = 0 To $iTotItems ControlSend ($sIP & " - PuTTY", "", "", $asCmd[$iCmd] & "{ENTER}") Next EndIf BlockInput(0) EndIf _Terminate() EndFunc ;=============================================================================== ; Function Name: MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam) ; Description: None ; Parameter(s): None ; Requirement(s): None ; Return Value(s): None ; Author(s): Holger ;=============================================================================== Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam) $nNotifyCode = BitShift($wParam, 16) $nID = BitAnd($wParam, 0x0000FFFF) $hCtrl = $lParam If $nID = $lstServer Then Switch $nNotifyCode Case $LBN_DBLCLK _Start() Return 0 EndSwitch EndIf EndFunc Thanks, Stuntman
-
Hi Guys, I have become stuck writing to ssh, I manage to do it if I am logged on - but the script doesnt complete while logged off. I have tried useing ControlSendPlus - but that doesnt help, and I hav also tried using a UnixCmd.au3 which someone put on the forum, that launches putty for you - that I can actually get to work - but the downfall there is that before that executes it lauches a silly little window with a list of my servers in which I cant seem to get control of. Anyway below is my basic ssh script, and the UnixCmd.au3 which launches putty and the UnixCmd.ini which the program uses. include "C:\AutoDeploy\ControlSendPlus.au3" ;my script Run("C:\Program Files\OpenSSH\bin\ssh -l jde 10.56.154.1") ProcessWait("ssh.exe") sleep(5000) $sshWind = WinGetHandle("C:\Program Files\OpenSSH\bin\ssh.exe") ControlSend($sshWind, "", "", "1029{ENTER}") sleep(2000) ControlSend($sshWind, "", "", "rm -R /u03/jdedwardsoneworld/AUTODEPLOY{ENTER}") sleep(2000) ControlSend($sshWind, "", "", "exit{ENTER}") ;UnixCmd.au3 #Region Compiler directives section ;** This is a list of compiler directives used by CompileAU3.exe. ;** comment the lines you don't need or else it will override the default settings ;#Compiler_Prompt=y ;y=show compile menu ;** AUT2EXE settings ;#Compiler_AUT2EXE= ;#Compiler_Icon=Wizard.ico ;Filename of the Ico file to use ;#Compiler_OutFile= ;Target exe filename. #Compiler_Compression=4 ;Compression parameter 0-4 0=Low 2=normal 4=High #Compiler_Allow_Decompile=y ;y= allow decompile ;#Compiler_PassPhrase= ;Password to use for compilation ;** Target program Resource info #Compiler_Res_Comment=Unix Shell Management #Compiler_Res_Description=Unix Shell Management #Compiler_Res_Fileversion=1.2 #Compiler_Res_LegalCopyright=Giuseppe Criaco ; free form resource fields ... max 15 #Compiler_Res_Field=Email|gcriaco@sogei.it ;Free format fieldname|fieldvalue #Compiler_Res_Field=Release Date|1/25/2006 ;Free format fieldname|fieldvalue ;#Compiler_Res_Field=Name|Value ;Free format fieldname|fieldvalue ;#Compiler_Res_Field=Name|Value ;Free format fieldname|fieldvalue #Compiler_Run_AU3Check=y ;Run au3check before compilation ; The following directives can contain: ; %in% , %out%, %icon% which will be replaced by the fullpath\filename. ; %scriptdir% same as @ScriptDir and %scriptfile% = filename without extension. #Compiler_Run_Before= ;process to run before compilation - you can have multiple records that will be processed in sequence #Compiler_Run_After=move "%out%" "%scriptdir%" ;process to run After compilation - you can have multiple records that will be processed in sequence #EndRegion ;=================================================================================================== ================================================ ; ; Program Name: UnixCmd() ; Description: Unix Shell Management ; Parameter(s): None ; Requirement(s): UnixCmd.ini, PuTTY Executable ; Return Value(s): None ; Author(s): Giuseppe Criaco <gcriaco@quipo.it> ; ;=================================================================================================== ================================================ ; #Region - Include and Declarations AutoItSetOption("TrayIconDebug", 1) ;Debug: 0=no info, 1=debug line info #include <string.au3> #include <GuiConstants.au3> Global Const $WM_COMMAND = 0x0111 Global Const $LBN_SELCHANGE = 1 Global Const $LBN_DBLCLK = 2 Dim $asCmd[50], $iCmd = 0, $ip, $sHostName, $sEncryptPwd, $sPwd, $sUser, $iSleep = 1000, $sPutty, $iSendKeyDelay = 50 #EndRegion - Include and Declarations #Region - GUI objects creation GuiCreate("UnixCmd v. 1.2", 235, 375,(@DesktopWidth-325)/2, (@DesktopHeight-285)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GUICtrlCreateLabel("Server List:", 10, 10, 135, 30) $lstServer = GuiCtrlCreateList("", 10, 30, 215, 310) $btnOk = GuiCtrlCreateButton("&Start", 75, 340, 70, 25, $BS_DEFPUSHBUTTON ) $btnExit = GuiCtrlCreateButton("&Exit", 155, 340, 70, 25) HotKeySet("{ESC}", "_Terminate") #EndRegion - GUI objects creation #Region Management If (Not FileExists(@ScriptDir & "\UnixCmd.ini")) Then #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Warning MsgBox(48, "File Not Found", "Required file not found (" & @ScriptDir & "\UnixCmd.ini" & ")" & @CRLF & "" & @CRLF & "UnixCmd will now exit!!!") #EndRegion --- CodeWizard generated code End --- Exit EndIf ;General Options $sSection = IniReadSection(@ScriptDir & "\UnixCmd.ini", "General") If @error Then #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Critical MsgBox(16,"UnixCmd","Unable to read the section General") #EndRegion --- CodeWizard generated code End --- Exit Else ;Read Loop on the Section For $iSection = 1 To $sSection[0][0] Select Case $sSection[$iSection][0] = "Putty" $sPutty = $sSection[$iSection][1] EndSelect Next EndIf $var = IniReadSectionNames(@ScriptDir & "\UnixCmd.ini") If @error Then MsgBox(4096, "", "Error occured, probably no INI file.") Else ;Load ListBox For $i = 1 To $var[0] if $var[$i] <> "General" Then GUICtrlSetData($lstServer,$var[$i]) Next EndIf ; create the symmetric decryption key $sSymmetricKey = _StringToHex ("wef,5RDx") ;Register a user defined function for the Windows Message ID WM_COMMAND. GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $btnExit _Terminate() Case $msg = $btnOk _Start() EndSelect WEnd ;=============================================================================== ; Function Name: _StartPuTTY($sIP) ; Description: Start a Telnet session by PuTTY ; Parameter(s): None ; Requirement(s): None ; Return Value(s): None ; Author(s): Giuseppe Criaco <gcriaco@quipo.it> ;=============================================================================== Func _StartPuTTY($sIP) Run(Chr(34) & $sPutty & Chr(34) & " -load " & Chr(34) & $sHostName & Chr(34)) WinWait($sIP & " - PuTTY", "") If Not WinActive($sIP & " - PuTTY","") Then WinActivate($sIP & " - PuTTY","") WinWaitActive($sIP & " - PuTTY","") Sleep($iSleep) EndFunc ;==>_StartPuTTY Func _Terminate() Exit 0 EndFunc ;=============================================================================== ; Function Name: _Start() ; Description: None ; Parameter(s): None ; Requirement(s): None ; Return Value(s): None ; Author(s): Giuseppe Criaco <gcriaco@quipo.it> ;=============================================================================== Func _Start() $sHostName = GUICtrlRead($lstServer) $sSection = IniReadSection(@ScriptDir & "\UnixCmd.ini", $sHostName) If @error Then #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Critical MsgBox(16,"UnixCmd","Unable to read the section " & $sHostName) #EndRegion --- CodeWizard generated code End --- Exit Else ;Read Loop on the Section For $iSection = 1 To $sSection[0][0] Select Case $sSection[$iSection][0] = "IP" $sIP = $sSection[$iSection][1] Case $sSection[$iSection][0] = "User" $sUser = $sSection[$iSection][1] Case $sSection[$iSection][0] = "Pwd" $sEncryptPwd = $sSection[$iSection][1] ;Decrypt user password $sPwd = _StringEncrypt(0,$sEncryptPwd,_StringToHex ("wef,5RDx")) If @error = 1 Then #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Critical MsgBox(16,"UnixCmd","_StringEncrypt of " & $sEncryptPwd & " Failed") #EndRegion --- CodeWizard generated code End --- Exit EndIf Case $sSection[$iSection][0] = "SendKeyDelay" $iSendKeyDelay = $sSection[$iSection][1] Case $sSection[$iSection][0] = "Sleep" $iSleep = $sSection[$iSection][1] Case Else If StringLeft ($sSection[$iSection][0], 1) <> "#" Then $sCmdTmp = $sSection[$iSection][1] If StringIsXDigit($sCmdTmp) Then ;returns 1 ;Decrypt Item $asCmd[$iCmd] = _StringEncrypt(0,$sCmdTmp,_StringToHex ("wef,5RDx")) If @error = 1 Then ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Critical MsgBox(16,"UnixCmd","_StringEncrypt of " & $sCmdTmp & " Failed") Exit EndIf Else $asCmd[$iCmd] = $sCmdTmp EndIf $iCmd = $iCmd + 1 EndIf EndSelect Next BlockInput(1) ;Start a PuTTY Telnet/SSH Session _StartPuTTY($sIP) AutoItSetOption("SendKeyDelay", $iSendKeyDelay) ;Login to the server ControlSend ($sIP & " - PuTTY", "", "", $sUser & "{ENTER}") ControlSend ($sIP & " - PuTTY", "", "", $sPwd & "{ENTER}") ; Executes commands listed under the INI Section If $iCmd > 0 Then $iTotItems = $iCmd -1 $iCmd = 0 For $iCmd = 0 To $iTotItems ControlSend ($sIP & " - PuTTY", "", "", $asCmd[$iCmd] & "{ENTER}") Next EndIf BlockInput(0) EndIf _Terminate() EndFunc ;=============================================================================== ; Function Name: MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam) ; Description: None ; Parameter(s): None ; Requirement(s): None ; Return Value(s): None ; Author(s): Holger ;=============================================================================== Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam) $nNotifyCode = BitShift($wParam, 16) $nID = BitAnd($wParam, 0x0000FFFF) $hCtrl = $lParam If $nID = $lstServer Then Switch $nNotifyCode Case $LBN_DBLCLK _Start() Return 0 EndSwitch EndIf EndFunc ;UnixCmd.ini [General] Putty=C:\AutoDeploy\putty.exe [szaordv1] IP=10.56.154.1 User=jde Pwd=D1501DA3A043DDFF5FC7C3EC1DE108003FA2 sleep=3000 SendKeyDelay=100 Cmd1=rm -R /u03/jdedwardsoneworld/b7334/packages/AUTODEPLOY{ENTER} Cmd2=exit{ENTER} Anyone got some ideas for me, my goal is to remove a folder on a unix box - openssh works but only if im logged on, UnixCmd.au3 launches a app which I cant seem to execute the controls on? Thanks, Stunt
-
Ok I feel really stupid, sat till three in the morning trying to figure that one out. It was the while loop thanks SO much guys, my process does write to the logon screen now and have tested while also being logged of and it works perfect. Thanks again, Stuntman
-
Hi Guys, I am still having trouble sending. I initially wanted to test send keystrokes to a screen while I was logged off, I read that ControlSend can do that. Since the I have been battling to even get ControlSend to work while im logged on, let alone off!!! I have tried different variations from ControlSetTest, ControlCommand but none seem to do anything, am I being that stupid!!! Probably but anyway, does anyone have suggestions for me - keep in mind I am using ControlSend because Send was not working on my script when I was logged off the machine and thats really what I need, I have created a test script below but cant get that to work. THANKS: Run("c:\Windows\system32\notepad.exe") WinWait("Untitled - Notepad") While WinExists("Untitled - Notepad") sleep(100) wend AutoItSetOption("WinTitleMatchMode", 4) ; Get the handle of a notepad window $handle1 = WinGetHandle("Untitled - Notepad") $handle2 = ControlGetHandle ($handle1 , "" ,"Edit1") ; Send some text directly to this window's edit control ;ControlFocus ($handle1, "", $handle2) ;ControlSetText ($handle1, "", $handle2, "AbCdE") ControlSend($handle1, "", $handle2, "AbCdE")
-
Sending keystrokes while being logged out
Stunt replied to Stunt's topic in AutoIt General Help and Support
I am testting the ControlSend while being logged on just to check if that is working before I test it logged off, and its not writing the test? -
Sending keystrokes while being logged out
Stunt replied to Stunt's topic in AutoIt General Help and Support
Sorry let me clarify, here is a snippet of my code, I have read up on the site and found a post saying that you should try use ControlSend if you want to send keystrokes while being logged of the actuall machine, and to awnser your previous question, no im not trying to emulate a logon onto a computer, but I am trying to emulate a logon process while being physically logged off. Run("C:\oracle\ora92\bin\sqlplusw.exe") WinWaitActive("Oracle SQL*Plus") ControlFocus ("Oracle SQL*Plus", "", "Edit1") ControlSend ("Oracle SQL*Plus", "", "Edit1","sys") I have tried the above but ControlSend doesnt writ the "sys" to the box, any more suggestions? I have also tried the beta vervsion but same result -
Sending keystrokes while being logged out
Stunt replied to Stunt's topic in AutoIt General Help and Support
If it running as a service would it still give me the ability to send keystrokes to emulate a logon for instance? -
Hi All, I am trying to emulate a logon process onto a unix machine though openssh, as part of a bigger automation process. I have run into a stumbling block, my process works fine while I am physically logged onto the machine, but if I am not logged on and schedule a task to execute the script it does not perform the action, and I think it is due to a restriction of sending keystrokes while there is no logon?? Anyone got any advice for me?