Search the Community
Showing results for tags 'sendkey'.
-
Hello! I have made a program, that opens a folder, and then store the path ("C:\programFiles\etc") in a variable. Then i need to open the command panel as administrator, and write in the stored path, and some other text. Can i somehow instantly copypaste the text i needed, instead of writing in the command panel with the Send commands? #RequireAdmin #include <MsgBoxConstants.au3> Global Const $sMessage = "Select a folder" ; Display an open dialog to select a file. Global $sFileSelectFolder = FileSelectFolder($sMessage, "") If @error Then MsgBox($MB_SYSTEMMODAL, "", "Nem választottál ki mappát!") Exit EndIf Global $Tiff_path = $sFileSelectFolder & "\TiffChecker_2_32" FileCopy( "C:\TiffChecker_2_32.exe" , $sFileSelectFolder) $CMD = $Tiff_path & " " & $sFileSelectFolder & " /s/d" Run("C:\WINDOWS\system32\cmd.exe") WinWaitActive("C:\WINDOWS\system32\cmd.exe") Send($CMD) Sleep(1000) Send("{ENTER}") sleep(1000) MsgBox(0,"Press OK", "Press OK to continue") FileCopy("C:\Tiffchecker.txt", $sFileSelectFolder) Also, how do i close the command panel, when the program is finished? (usually its under 1 second, so after the send i just put a Sleep function there)
- 2 replies
-
- command prompt
- command panel
-
(and 3 more)
Tagged with:
-
I want to send key to On-Screen Keyboard (program in win 7) and then On-Screen Keyboard program send that key to notepad, but my script is not work, this is my script: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <Timers.au3> Global $nDelay,$handle,$pid; $nDelay = 2000 $gui = GUICreate("My GUI",200,100) $button_gen = GUICtrlCreateButton("Start",10,30,60) $button_stop = GUICtrlCreateButton("Stop",10,60,60) $handle = WinGetHandle('On-Screen Keyboard', "") $pid = WinGetProcess($handle) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $button_gen _Timer_SetTimer($gui, $nDelay, "AutoTDK") Case $button_stop _Timer_KillAllTimers($gui) EndSwitch WEnd GUIDelete() Func AutoTDK($hWnd, $Msg, $iIDTimer, $dwTime) WinActivate("Untitled - Notepad") ; active notepad program ControlSend($handle, "", $pid,"{SPACE}") ; send space key to On-Screen Keyboard EndFunc pls help me