# Search the Community

Showing results for tags 'cmd'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• General
• Announcements and Site News
• AutoIt v3
• AutoIt Help and Support
• AutoIt Technical Discussion
• AutoIt Example Scripts
• Scripting and Development
• Developer General Discussion
• Language Specific Discussion
• 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
• Hardware
• Information gathering
• Internet protocol suite
• Maths
• Media
• PDF
• Security
• Social Media and other Website API
• Windows
• Scripting and Development
• Operating System Deployment
• Windows Client
• Windows Server
• Office

• Forum
• AutoIt

### Calendars

• Community Calendar

• 0 Replies

• 0 Reviews

• 0 Views

Found 53 results

1. ## cmd Unicode text maker

Hi dear With this script you can print Unicode text in the CMD screen the script is easy to use just you write the text that contains Unicode in the first input and the script automatically reflect the code in the second input you can copy the text to the clipboard or you can try printing the text in the CMD window I apologize to everyone for colors and shape if not appropriate I'm a blind man and I do not see Thank you for your understanding Greetings to all of youCmdUtM.au3
2. ## Send text with Variables into CMD!

Hello Everyone, I seem to have run into an issue with Windows 10. When running (See Below) on windows 10 it prompt for user opens cmd as admin and does nothing. If I run the same code without (#RequireAdmin) everything works. I never had these issue with Windows 7 is there something I am missing. Thank you in advance! #RequireAdmin run ("cmd") WinWaitActive ("Administrator: C:\WINDOWS\SYSTEM32\CMD.exe") ControlSend ("Test") Send("{enter}")
3. ## Free console after _WinAPI_AttachConsole()

Hi. Thanks to this post (https://www.autoitscript.com/forum/topic/189553-writing-to-cmd/?do=findComment&comment=1361142) I can now write a helpfile to the cmd when for instance passing parameter -h or -help at cmd. But then cmd is blocked by the script (I had to free it with CTRL+BREAK): #include <WinAPI.au3> _WinAPI_AttachConsole() $hConsole = _WinAPI_GetStdHandle(1) _WinAPI_WriteConsole($hConsole, "Print helpfile................" & @CRLF) Inside MSDN Library then I found this sentence: A process can use the FreeConsole function to detach itself from its console. But I don't find something like _WinAPI_FreeConsole(). How can I do it in another way? Regards, Conrad
4. ## Return a sentence in cmd when launch from it

Hello I would like to know if there is a way to return a sentence in cmd when I launch from it (because I add arguments). For example, diskpart.exe which help to manage the key and hdd connected, when you launch it with the parameter "/f" the app return a sentence saying that it don't recognize the parameter "/f" and it return the sentence in the cmd where i started the application, not a new one. That's what I want to do but I couldn't find anything that would solve my problem on internet and on AutoIt like ConsoleWrite / ConsoleWriteError (don't work). Thanks
5. ## Capturing PSEXEC's command line output

I'm attempting to capture the output from the command line tool PSEXEC. I'm using AutoIT to run an instance of PSEXEC against a remote PC to audit Local Admins in my environment using net.exe (C:\Windows\System32> net localgroup administrators). However the usual trick I use to capture command line output does not appear to work well with PSEXEC, as the bottom portion of the output is missing from the return. Any ideas or recommendations are greatly appreciated. Here is what I'm working with: ;This script will read from a list of hosts and report who has local admin privileges on the machine #RequireAdmin Global $fileName = @ScriptDir & '\test.txt' ;hostlist, one host per line readHostList() ;Read list of hosts Func readHostList() Local$file = FileOpen($fileName, 0) While 1$line = FileReadLine($file) If @error = -1 Then ExitLoop ConsoleWrite($line & @CRLF) ;MsgBox(0,0,$line) getLocalAdmins($line) WEnd FileClose($file) EndFunc ;run PSEXEC to list local admins Func getLocalAdmins($remotePC) Local $testFile = @ScriptDir &'\test234.txt' FileOpen($testFile, 1) Local $psexec = 'psexec \\' &$remotePC & ' net localgroup administrators' FileWriteLine($testFile, _RunCmd($psexec) ) FileClose($testFile) EndFunc ;Used to return CLI output Func _RunCmd($sCommand) Local $nPid = Run(@Comspec & " /c" &$sCommand, @SystemDir, @SW_Hide, 8), $sRet = "" If @Error then Return "ERROR:" & @ERROR ProcessWait($nPid) While 1 $sRet &= StdoutRead($nPID) If @error Or (Not ProcessExists ($nPid)) Then ExitLoop WEnd Return$sRet EndFunc ## If i manually run the command on the remote PC via PSEXEC I will get the following output: PsExec v2.11 - Execute processes remotely Copyright (C) 2001-2014 Mark Russinovich Sysinternals - www.sysinternals.com Starting net on PCNAME... on PCNAME... net exited on PCNAME with error code 0. ------------------------------------------------------------------------------- admin Administrator Alias name administrators Domain\Domain Admins Comment Administrators have complete and unrestricted access to the computer/domain Members The command completed successfully. ## The returned output from running the above script is as follows: PsExec v2.11 - Execute processes remotely Copyright (C) 2001-2014 Mark Russinovich Sysinternals - www.sysinternals.com Alias name administrators Connecting to PCNAME... Starting PSEXESVC service on PCNAME... Connecting with PsExec service on PCName... Starting net on PCNAME.. net exited on PCNAME with error code 0. **Note to test this script PSEXEC must be in the system dir or the path in the script changed PSEXEC tool: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec

×

• Wiki

• Back

• Git