
_GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET) GUICtrlSetData($idInput, _CmdInfo() & $SB_SCROLLCARET) GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKWIDTH, 1 Local $idButton = GUICtrlCreateButton("NetStat", 10, 10, 190, 25) GUICtrlSetFont(-1, 10, 400, Default, "COURIER NEW") Local $idExititem = GUICtrlCreateMenuItem("Exit", $idFilemenu)

Local $idFilemenu = GUICtrlCreateMenu("&File") Hello people, I have a script which calls CMD and executes the netstat command, but when I run it through SCITE the GUI opens but I have no output, How can I run the command as administrator? **Note to test this script PSEXEC must be in the system dir or the path in the script changed # The returned output from running the above script is as follows:Ĭonnecting with PsExec service on PCName. on PCNAME.Ĭomment Administrators have complete and unrestricted access to the computer/domain PsExec v2.11 - Execute processes remotely # If i manually run the command on the remote PC via PSEXEC I will get the following output: GetLocalAdmins ( $line ) WEnd FileClose ( $file ) EndFunc run PSEXEC to list local admins Func getLocalAdmins ( $remotePC ) Local $testFile = & '\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 ( & " /c" & $sCommand, ,, 8 ), $sRet = "" If then Return "ERROR:" & ProcessWait ( $nPid ) While 1 $sRet &= StdoutRead ( $nPID ) If Or ( Not ProcessExists ( $nPid ) ) Then ExitLoop WEnd Return $sRet EndFunc ReadHostList ( ) Read list of hosts Func readHostList ( ) Local $file = FileOpen ( $fileName, 0 ) While 1 $line = FileReadLine ( $file ) If = - 1 Then ExitLoop ConsoleWrite ( $line & ) MsgBox(0,0,$line) This will take effect after the system is restarted.Expand collapse popup This script will read from a list of hosts and report who has local admin privileges on the machine #RequireAdmin Global $fileName = & '\test.txt' hostlist, one host per line The following message appears when the global flag is enabled, SUCCESS: The system global flag 'maintain objects list' is enabled. To enable the Maintain Objects List global flag, type: openfiles /local on To check the current status of the Maintain Objects List global flag, type: openfiles /localīy default, the Maintain Objects List global flag is disabled, and the following message appears, INFO: The system global flag 'maintain objects list' is currently disabled. Syntax openfiles /local Įnables or disables the system Maintain Objects List global flag, which tracks local file handles. Enabling the Maintain Objects List global flag might slow down your system. To query and display all open files on the remote system srvmain by using the credentials for the user hiropln on the maindom domain, type: openfiles /query /s srvmain /u maindom\hiropln /p made by using the on or off option don't take effect until you restart the system. To query and display all open files in list format with detailed information, type: openfiles /query /fo list /v To query and display all open files in table format without headers, type: openfiles /query /fo table /nh To query and display all open files, type: openfiles /query Specifies that detailed (verbose) information be displayed in the output. Valid only when the /fo parameter is set to TABLE or CSV. CSV - Displays output in Comma Separated Values (CSV) format.
HOW TO OPEN KEEPSAFE FILES ON PC WITH CMD PASSWORD
If you don't use the /p option, a password prompt appears when the command is run.ĭisplays the output in the specified format. Specifies the password of the user account that is specified in the /u option.

If you don't use the /u option, system permissions are used by default. Runs the command using the permissions of the specified user account. This parameter applies to all files and folders that are specified in the command.

If you don't use the /s option, the command is run on the local computer by default. Specifies the remote system to connect to (by name or IP address). openfiles /disconnectĮnables an administrator to disconnect files and folders that have been opened remotely through a shared folder. This command also enables or disables the system Maintain Objects List global flag. Enables an administrator to query, display, or disconnect files and directories that have been opened on a system.
