Jump to content

Search the Community

Showing results for tags 'command'.



More search options

  • 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


Location


WWW


Interests

Found 14 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. Hello my friends I have an inquiry after your permission I found a function to get the special line commands for any operation It requires the name of the process to be searched I want to use it to know the process Is this possible with this function Here is the code Func commandLineGet($proc, $strComputer=".") dim $array[1] local $ArrayNumber local $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") local $oProcessColl = $oWMI.ExecQuery("Select * from Win32_Process where Name= " & '"'& $Proc & '"') local $Process For $Process In $oProcessColl $Process = $Process.Commandline ReDim $Array[UBound($Array)+1] $ArrayNumber = UBound($Array)-1 $array[$ArrayNumber] = $Process Next $ArrayNumber = UBound($Array)-1 $array[0] = $ArrayNumber return $array EndFunc
  3. Hello all, I've written the code below which launches chrome in incognito mode and then proceeds to go to the autoit website. From my understanding, the Run() command is also supposed to output the PID number related to the application that got launched from the Run command. However when I run the below lines, it outputs a PID number that is different from the newly launched chrome browser's PID number, does anyone know why and possibly explain how I could retrieve the accurate PID number associated with the newly launched browser? Global $iPid = Run(@ComSpec & ' /c start chrome.exe https://www.autoitscript.com/forum/ -incognito' ,"", "") msgbox(0,"",$iPid) Thank you, Brian
  4. Hello, I compiled a script I made that takes a command line parameter (the version of a .msi installer) when launched. The script was compiled with the /console option. The script (.au3) works fine but the executable returns the following error: Error: array variable has incorrect number of subscripts or subscript dimension range exceeded
  5. Hi all, I need to start a script that include: - admin privileges - multiple cmd commands - no bat, no exe, no tmp files created anywhere (especially in the user temp folder) In a bat file it would be simple, but users shouldn't see what commands I'm sending. Example of the script: echo off cls echo. echo I AM A TOOL echo. echo NOTE: echo - note 1 echo - note 2 echo - etc set USER1=0 set COMPUTER1=0 if /i %username% equ user.user ( set USER1=1 set COMPUTER1=1 ) if /i %username% equ another.user set USER1=1 if /i %computername% equ notebook set COMPUTER1=1 if %USER1% EQU 1 ( if %COMPUTER1% EQU 1 ( reg delete "HKLM\SOFTWARE\blablabla" /f ) else ( echo Computer not authorized. Contact assistance.) ) else ( echo User not authorized. Contact assistance.) echo. pause exit With the send("") is a disaster. I'm a noob here, so what can I do? EDIT: OR ELSE I explain the situation and what I need, so if there is a simple solution I can use that. SITUATION: our domain users have Users rights on the machine. Some of them need administrator rights. We create a local user with administrator rights, so that the users must insert username and password when asked to run something with administrator rights. We have an internal domain group policy that blocks EXE, BAT, COM, TMP files from the user local temp directory, for a security reason (malware). That also blocks most software installation. But some users are often out of office, away from workplace and in another country, they need a complete control on their computers. WHAT I NEED: I need to check the username and the computer name. If the username is the one with local administrator rights and the computer name is a computer that is qualified to temporary remove the policy, then I need to execute a REG DELETE command with administrator rights. I hope I explained myself. Thank you very much.
  6. If I run "stripcat scandataF.dta" (or scandataF.bat which has same script) from command line it works without error but if I run from AutoIt script it fails I have tried ; > not work $DOS = RunWait(@ComSpec & ' /c "stripcat.exe "scandataF.dta' & @CRLF, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ; $DOS = RunWait(@ComSpec & " /k " & "scandataF.bat" & @CRLF, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ; Run("scandataF.bat") The "not work" line doesn't throw any error but also doesn't function. Both Run & RunWait do throw the Micro$oft error.
  7. How to enable file sharing for all public,private,work,home networks. I mean programatically using AutoIT.
  8. Is there a way to execute the text inside a variable is if it was part of the script? In this example I'd like to get a message box pop up but I don't: ;testme.au3   local $var = 'msgbox(64,"hello","world")'   $var is there a command that can be used like maybe 'Exec' or 'Execute' or something?   local $var = 'msgbox(64,"hello","world")'   Execute $var
  9. I have a script that changes the path to a file inside a program, the program itself is a pain in the @## I have no idea what language was coded with but the autoit windows info doesn't even recognize 90% of the gui. Anyway I need to send the new path which is inside the local app folder, I'am using a variable to hold it. but the User folder has the "#" character in the name and for some reason autoit won't send it, it just stops right before the "#" and doesn't send the rest of the path either. it doesn't return any error it just stops sending, the rest of the script is still executed. I'm using the Send() command to send the keys. Here's what I have: $dbPath = @UserProfileDir & '\AppData\Local\database\db.mdb' Run("Notepad.exe") WinWait("Untitled - Notepad") WinActivate("Untitled - Notepad") Send($dbPath) Now in my case @UserProfileDir is called Tech #1 so what I'm expecting Send() to type is C:\Users\Tech #1\AppData\Local\database\db.mdb But what I'm actually getting is just C:\Users\Tech notice there's the space after the "h", so it is stopping exactly before the "#" Now you might say why I need to use a var instead of just sending the actual string path, well I don't want to do a separate script for all the computers and guess what, they all have the "#" in their user names, yes Tech #2, Tech #3, Tech #4, Front #1, Front #2, Shipping #1... and so on. BTW on a side note, I noticed the autoit macros page shows the @LocalAppDataDir as a viable macro but it's not working for me, it return "unknown macro", I had to use @UserProfileDir and and the \AppData\Local, because the @AppDataDir takes me to Roaming anyway. While I was writing that last paragraph, I said to my self, yeah why not just copy and paste the script and compile as many as I need but use plain text instead of a variable, so I went back and did just Run("Notepad.exe") WinWait("Untitled - Notepad") WinActivate("Untitled - Notepad") Send("C:\Users\Tech #1\AppData\Local\database\db.mdb") Guess what!!!, yeah you guessed it, it did the same thing, it stopped right before the "#". I know most will be thinking, nah he's crazy why would that happen, go ahead and try for yourself, I'll wait... (because I tried in 3 different computers). Ok so you are back, did it work for you? can you explain why it's not working for me, or it didn't work for you as well and you are as clueless as me? And while I was writing all this my brain was working on the background and I just had an idea to work around it, I'll be right back... $dbPath = @UserProfileDir & '\AppData\Local\DiGital WorkShop\POS Panic\PM229.mdb' Run("Notepad.exe") WinWait("Untitled - Notepad") WinActivate("Untitled - Notepad") ClipPut($dbPath) Send("{CTRLDOWN}v{CTRLUP}") Ok so this actually works for me and I can finally breath, but I'm still annoyed by the fact that autoit won't Send("#1") or Send("#2"), yes I actually tried just sending that and nothing, and I just realize what is doing, (this lecture will annoy most people lol), by sending #1, #2, #3 ans so on it is activating windows in the same order they are pinned in the taskbar, I had autoit first, then chrome, the my mail app, so every time I use Send("#1") activates autoit, which I didn't noticed at all because well I was using autoit, but then when I Send("#2") and it brought chrome to the front, then Send("#3") and activated my mail app (which btw was minimized). What in the world is happening some please explain me this behavior and please tell me how would you workaround the issue. Thanks.
  10. Hi. I like to use au3 abbreviations. 'mb2' is often used. But I don't remember them very long. So I wanted to have a little tool looking for it. This tool is embedded as a command inside SciTE. First the tool itself: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Comment=Looks for an au3-abbreviation of a word in Clipboard or $CmdLine. #AutoIt3Wrapper_Res_Description=Looks for an au3-abbreviation of a word in Clipboard or $CmdLine. #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #AutoIt3Wrapper_Res_LegalCopyright=Simpel #AutoIt3Wrapper_Res_Language=1031 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <File.au3> Global $Ini = @ScriptDir & "\au3abbrev.ini" Global $au3abbrev = "PUT IN HERE THE PATH TO\au3abbrev.properties" ; mine is at …\AutoIt3\SciTE\au3abbrev.properties Global $aGetEntries Global $sSearch, $sOutput FileCopy($au3abbrev, $Ini, 1) ; make an ini from the properties file _FileWriteToLine($Ini, 1, "[Dictionary]") ; inserting '[Dictionary]' at first line, to make ini searchable #Region - Look for the right searchstring If StringLeft($CmdLineRaw, 13) = "/ErrorStdOut " Then ; if not compiled but run with F5 to test $sSearch = ClipGet() ElseIf $CmdLineRaw <> "" Then $sSearch = $CmdLineRaw ElseIf ClipGet() <> "" Then $sSearch = ClipGet() Else MsgBox(0, 'Fehler', "Kein Wort zum Suchen gefunden.") ; error Exit EndIf #EndRegion _GetDefinition() $sSearch = _Clean($sSearch) $sOutput = _Search($sSearch) MsgBox(0, 'au3abbrev.properties', "Ergebnisse für '" & $sSearch & "':" & @CRLF & @CRLF & $sOutput) Exit #Region - Functions Func _GetDefinition() If FileExists($Ini) Then $aGetEntries = IniReadSection($Ini, "Dictionary") If @error Then MsgBox(0, 'Fehler', "Keine Sektion [Dictionary] gefunden.") ; if inserting of "[Dictionary]" failed Exit EndIf EndIf EndFunc Func _Search($sInput) Local $iCounter = 1 Local $sfOutput For $i = 1 To $aGetEntries[0][0] If StringInStr($aGetEntries[$i][1], $sInput) Then ; something is found $sfOutput = $sfOutput & _Clean($aGetEntries[$i][0]) & @TAB & _Clean($aGetEntries[$i][1]) & @CRLF & @CRLF $iCounter = $iCounter + 1 EndIf Next If $sfOutput = "" Then $sfOutput = "KEINE ÜBEREINSTIMMUNG" ; no matches found EndIf Return $sfOutput EndFunc Func _Clean($sData) $sData = StringReplace($sData, "|", "") ; erases "|" because it causes the array to jump to the next entry $sData = StringReplace($sData, '"', "") ; erases '"' because it sometimes causes the array to jump to the next entry Return $sData EndFunc #EndRegion And now the part at SciTEUser: # 41 LookAU3Abbrev command.41.*="H:\_Conrad lokal\Downloads\AutoIt3\_COX\AU3-Abkuerzung.exe" "$(CurrentSelection)" command.name.41.*=Look Abbrev command.shortcut.41.*=Ctrl+Shift+Alt+A command.save.before.41.$(au3)=2 So I mark a regular AutoIt command inside SciTE (with double clicking) and press Ctrl+Shift+Alt+A. I will get a messagebox as answer what abbreviations will contain my sended command. But be careful, not all of these listed abbreviations will expand with space while coding. Abbreviations you want to use have the be declared inside the au3abbrev.keyword.properties(?) Any suggestions? Regards, Conrad
  11. I have a function that runs a DOS command and returns the output of the command, and it returns the correct data for some commands, bu tnot for others. I've narrowed it down to this: "HELP FIND" returns nothing "HELP DIR" returns several strings of help info. Here's my test code: #include <Constants.au3> test() Func test() Local $sSTDOUT, $cmd $cmd = "C:\Windows\System32\help.exe find" ;$cmd = "C:\Windows\System32\help.exe dir" $sSTDOUT = _RunDosCmd($cmd) ConsoleWrite("+++: $sSTDOUT ==>" & $sSTDOUT & "<==" & @CRLF) MsgBox(0, "INFO", "$sSTDOUT ==>" & $sSTDOUT & "<==") EndFunc ;==>test Func _RunDosCmd($sDosCmd) Local $cmd, $iPID, $sSTDOUT, $ar, $err $cmd = @ComSpec & ' /C ' & $sDosCmd ConsoleWrite("+++: $cmd = " & $cmd & @CRLF) ; Run the command, capturing the STDOUT data $iPID = Run($cmd, "", @SW_HIDE, $STDERR_MERGED) ; <== merge STDOUT and STDERR ; Success: the PID of the process that was launched. ; Failure: 0 and sets the @error flag to non-zero. $err = @error ConsoleWrite("+++: $err = " & $err & " after call to Run()" & @CRLF) ConsoleWrite("+++: $iPID = " & $iPID & " after call to Run()" & @CRLF) If ($err) Then ConsoleWrite("+++: Error returned by Run()" & @CRLF) Return ("") EndIf ; Wait until the process has closed using the PID returned by Run. ProcessWaitClose($iPID) ; Success: 1 and sets @extended to the exit code of the process. ; Failure: 0 if the wait timed out. On invalid PID the @error flag ; is set to non-zero and @extended is set to 0xCCCCCCCC. $err = @error ConsoleWrite("+++: @error = " & $err & " after call to ProcessWaitClose()" & @CRLF) ; Read the merged STDOUT/STDERR stream of the PID returned by Run. $sSTDOUT = "" While (1) $sSTDOUT &= StdoutRead($iPID) $err = @error If ($err) Then ExitLoop WEnd Return ($sSTDOUT) EndFunc ;==>_RunDosCmd
  12. Hello, I'm having an issue, i need to send a + with a rundos command and when i do this it capitalizes the letter right after it and removes the +. For example the code reads: +r but the output is R. Is there any way around this? I have the command in quotes. thank you.
  13. Each time I want try a Command Line Tool I don't remember his switchs ! So I have made this little utility : Get command line parameters Utility v1.0.2.3 The difficulty is they don't answer the same way or not at all ! Script start by trying common switches by 2 ways and leaves you try manually after. You also have the possibility to use an embeded Dos Prompt instead of the edit box. In all cases you can create a text file for save infos. Type "ESC" for quit at any time. A first run compiled is needed for install a contextual menu for exefile. As usual externals files are downloaded at first execution. See Tray menu for options. Previous downloads : 628 Update 2012-06-30 Source : GetCommandLineParameters v1.0.2.3.au3 executable : GetCommandLineParameters.exe.html (Once this html file downloaded, double click on it for start the download) Sure it will help you !
  14. Well ,sometimes if you try to pen firefox hidden or minimized,doesn't work ,and when it works,you can't show it again on the monitor ShellExecute( "C:\Program Files\Mozilla Firefox\firefox.exe","Google - Mozilla Firefox","","open",@SW_HIDE) Sleep(2000) WinSetState( "Google - Mozilla Firefox","",@SW_SHOW)
×
×
  • Create New...