Jump to content

autoIT command panel need help


Recommended Posts

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)

Edited by Fortitude
Link to comment
Share on other sites

In theory you can use the clipboard functions, but you can also send without delay..


Opt("SendKeyDelay", 0) ;Default is 5 milliseconds

What do you mean by command panel?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Is there some reason you can't just run your executable directly, instead of very clunkily automating cmd.exe?

 

#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"
   RunWait($CMD);Run Executable directly
   MsgBox(0,"Press OK", "Press OK to continue")
   FileCopy("C:\Tiffchecker.txt", $sFileSelectFolder)

 

Link to comment
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
 Share

×
×
  • Create New...