Jump to content

Search the Community

Showing results for tags 'command prompt'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 11 results

  1. 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. How can I detect when a Command Prompt window has returned to idle with prompt for the next command please? For example, after a large paste: ControlClick("[CLASS:ConsoleWindowClass]", "", "", "right") ControlSend("[CLASS:ConsoleWindowClass]", "", "", "p") a large paste may be something like copying some large files which may go on for some time after the paste command has been given.
  3. Good morning AutoIt community! Today, I'm here to ask you if you know how to run an .exe from cmd.exe ( Command Prompt )... My intention is to read a .ini file where I store an information that has to be included in the shell, and run an .exe with that information... I'll give you an example Local $aFileCartellaAuditCopy = _FileListToArray($sPercorsoAuditCopy, "*.txt") If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante la lettura della lista dei file nella directory" & @CRLF & $sPercorsoAuditCopy & @CRLF & "Errore: " & @error) Return False Else Local $iPID = Run("cmd.exe" & ' /k "C:\Users\Portatile-60\Desktop\HmiCheckLogIntegrity.exe" "C:\Users\Portatile-60\Desktop\AuditTrailDosaggio0_20170327_151335_DOSAGGIO_PW_01.txt"') ; & " /k " & '"' & $sHmiCheckLogIntegrity & '"' & " " & '"' & $sPercorsoAuditCopy & "\" & $aFileCartellaAuditCopy[1] & '"', "", @SW_SHOW, $STDOUT_CHILD) Return True EndIf This code is in a function, that returns False if it can retrive at least a file from the path stored in the .ini file... Else I would like to run the Command Prompt with the .exe and with a parameter of that .exe, but it seems to not work properly. Could please anyone tell me why? Thanks
  4. I need to create a new administrator account on a number of computers, so figured I would make a script to do it. You can only add/modify admin profile from an elevated command prompt (administrator command prompt). So I tried writing that into my short script. I thought that my "RunAs" command below would do the trick, but it opens a standard cmd window through the admin profile. Anyone able to tell me how to get it to open the elevated cmd? RunAs("administrator",@ComputerName,$sAdminPassword,0,@ComSpec) Sleep (500) Send("net user /ADD " & $sUsername & " " & $sPassword) Send("{ENTER}") Send("Y") Send("{ENTER}") Send("net user " & $sUsername & " /passwordchg:no") Send("{ENTER}") Send("net localGroup administrators " & $sUsername & " /ADD") Send("{ENTER}") WinClose("C:\Windows\system32\cmd.exe")
  5. Hi all, I am working on a application with a GUI and command prompt in 1. Currently my code looks this simple > #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_Change2CUI=y #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 437, 192, 124) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd But when I compile this and run the compiled version there is also a command prompt shown. But I don't want this. Besides that, I also want it to be possible when I run my script from the command prompt, the program will give feedback in the command prompt where it was started from. With the setup above. This is possible with the ConsoleWrite command. Is it possible to hide the command prompt one way or another when I start the GUI? Or do I have to change my script? I hope someone can help me. Regards, lrstndm
  6. When I execute any batch command then it is prompting a command window for 1 second till the command executes with the below command. $CMD = "net localgroup administrators domainaname\usename /add" RunWait(@ComSpec & " /q /c " & $CMD) Is there any way to exeute the command without showing the window.
  7. Trying to make a script where it will run a command to show me the model name AND serial tag info on a laptop remotely and copy it to keyboard step by step. I know how to do this via WMIC but I'm curious how to create a CMD script out of it so I can just one click. So it would look something like.... wmic csproduct get name*copy to clipboard* "Press enter to advance"[Enter]wmic csproduct get identifyingnumber*copy to clipboard* "Finished"Any ideas?
  8. Hello, I am checking code with Microsoft BinScope 2014. It runs in a command line. You may be familiar with it if you are testing security for DLLs. Anyway, I get a directory of .DLL and corresponding Symbol .PDB files from developers. The .dll and .pdb filenames have to match to run BinScope on them. I create an array of DLL files, then an array of PDB files, compare the files to make sure I am only testing matching filenames, and then running them through BinScope. I have the automated script running but because I am having problem with @ComSpec, I am using Run("CMD.exe"). It leaves a DOS box for every file. Here is some code: For $i = $iDllCount to $aTestDllList[1] $iDllCount += 1 $sCmd = "Binscope "&$sPath&$sDllFile ;MsgBox($MB_OK,"","File to test is "&$sDllFile&" DLLCount is "&$iDllCount) Run("CMD.exe","") Sleep(500) Send("CD C:\Program Files\Microsoft BinScope 2014\{Enter}") Sleep(500) Send($sCmd&"{Enter}") ;RunWait(@ComSpec & " /c " & "Binscope /Target "&$sDllFile,'""C:\Program Files\Microsoft BinScope 2014\""') Commented out Next If I could use RunWait(@ComSpec " /c "... the DOS box would close automatically. However I can't get that to work. I have tried RunWait(@ComSpec&" /k "&'""Binscope.exe C:\testdll\apiREST.dll""', '""C:\Program Files\Microsoft BinScope 2014""') RunWait(@ComSpec&" /k "&'""C:\Program Files\Microsoft BinScope 2014\Binscope.exe C:\testdll\apiREST.dll""', '""C:\Program Files\Microsoft BinScope 2014""') In any case using the RunWait command does not work. Using Run("CMD.exe") does. I would like to close the DOS box after each file is run. I need to either get RunWait (@ComSpec...) running OR close each DOS box after BinScope is done. Any help is appreciated! JibsMan
  9. #include <Constants.au3> HotKeySet("{ESC}", "_Exit") Global $up= Ping("www.bing.com") Do $date = @MDAY & "" & @MON & "" & @YEAR $time = @HOUR & "" & @MIN & "" & @SEC Run(@ComSpec & ' /c ping -t -s 1 myservername >> %userprofile%\desktop\' & $date & $time & '.txt', @SystemDir, @SW_show) ConsoleWrite($up & @LF) sleep(5000) Send("^+c") _ProcessCloseEx("cmd.exe") ;Send("!+{F4}") until $up=0 Func _Exit() Exit EndFunc ;==>_Exit Func _ProcessCloseEx($sPID) ;ConsoleWrite($sPID & @LF) local $killLync = $sPID ;ConsoleWrite($killLync & @LF) If IsString($sPID) Then $sPID = ProcessExists($sPID) ;ConsoleWrite($sPID & @LF) If Not $sPID Then Return msgbox(64,"Lync Status","Lync is not Running");SetError(1, 0, 0) Return Run(@ComSpec & " /c taskkill /F /PID " & $sPID & " /T", @SystemDir, @SW_HIDE) & TrayTip($killLync,"Killed", 5, 1) EndFunc Hi Guys, need some helps here This is my pinging code. I was trying to ping continuously to my office server. now the issue I hit was I couldn't get the cmd windows close once its running. It opens a new one after the and old one stayed after the looping. I tried to search around, but no luck I couldn't find the solution. The workaround for me right now is kill the process by PID. Really appreciate someone can take a look into it.
  10. So I'm working on a general maintenance script. Part of it is to run chkdsk (just check no /f /r) and report that to a file. So far whenever i run the script, everything works perfectly, but i get errors on the chkdsk readout file, but then if i follow up with running chkdsk manually i get no errors. even piping results to a file. so far has happened on a Dell XPS and Dell Precision both using the original factory image (Win 7), and a Dell Vostro 200 (Win XP)that has been reformatted like a week ago. The error is always with the volume bitmap. Here's the script im running: If ProcessExists ("chkdsk.exe") <> 0 Then $pretime = TimerInit() While ProcessExists("chkdsk.exe") <> 0 Sleep(1000) If TimerDiff($pretime) >= 1800000 Then FileWriteLine ( $DiskSick, _NowCalc() & " Checkdisk was already running. Appears to be hung") $Defrag = 0 ExitLoop EndIf WEnd Else FileDelete (@WorkingDir & "Checklog.txt") Sleep(1000) $checklog = @WorkingDir & "Checklog.txt" $qchecklog = Chr(34) & $checklog & Chr(34) Run (@ComSpec & " /c chkdsk >> " & $qchecklog) $runinit = TimerInit() While ProcessExists("chkdsk.exe") <> 0 Sleep(1000) If TimerDiff($runinit) >= 1800000 Then FileWriteLine ($DiskSick, _NowCalc() & " Checkdisk appears to have hung") $Defrag = 0 ExitLoop EndIf WEnd While ProcessExists("cmd.exe") <> 0 Sleep(1000) If TimerDiff($runinit) >= 1800000 Then FileWriteLine ($DiskSick, _NowCalc() & " Checkdisk appears to have hung") $Defrag = 0 ExitLoop EndIf WEnd EndIf edit. Fixed the autoIT to show loops correctly
  11. I am trying to get information from a DOS-window by getting a spesific line of information (SID) I found the _RunDOS ( $sCommand ) function, but I could not find any way to get the information or store it in any way(variable/notepad/....) Anyone got any idéa? =) Can be a dos command, VBScript or anything, just need it stored somewhere I can read Kind Regards, Akarillon
×
×
  • Create New...