Markus23 Posted November 24, 2010 Share Posted November 24, 2010 Hi ! I need to get the commandline options of running process(es) (msaccess.exe), already tried standard "ProcessList()" but this function only delivers program-name and pid. Also tried "_ProcessListProperties()" . This function works fine BUT it needs local admin rights for the user. Is it possible to read all running msaccess.exe into an array with its commandline options AND without having the user to be local admin ? Thanks in advance, Markus Link to comment Share on other sites More sharing options...
Ascend4nt Posted November 24, 2010 Share Posted November 24, 2010 Make sure that msaccess.exe is running in the same or a lower bit-mode than the script you are running, and that it has the same privilege level if running Vista+ O/S's. I have a function in my Processes,Threads & DLL's UDF that also gets command line (as well as environment and misc. other strings) - but it has the same requirements. (script>=bit-mode of process and script>=privilege level of process). My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
Fire Posted November 24, 2010 Share Posted November 24, 2010 (edited) Hello.(if a remember correctly this can be done using Autoit Object winmgmts:\\ method without elevated rights.)Here is WMIC way:wmic process where (name="msaccess.exe") get commandlineThis will output msaccess.exe command line parameters.I'm sorry dude i can'not help to you more than this ( because i have no experience with objects:( )Edit:Figured it out.Here is:;Grabbed and modified from here ==> http://www.autoitscript.com/autoit3/files/beta/autoit/COM/Wmi-terminate.au3 showmeitpliz("cfp.exe") ;=> Comodo FW process ==>cfp.exe (define your proc.exe) ;~ Now calling funcsion Func showmeitpliz($proc, $strComputer=".") $proc="cfp.exe" ;=> Comodo FW process ==>cfp.exe (define your proc.exe) $oWMI=ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") $oProcessColl=$oWMI.ExecQuery("Select * from Win32_Process where Name= " & '"'& $Proc & '"') For $Process In $oProcessColl $Process=$Process.Commandline MsgBox(0,"",$Process) Next EndFunc; ==>showmeitpliz()It gives for me: Edited November 24, 2010 by Fire [size="5"] [/size] Link to comment Share on other sites More sharing options...
Markus23 Posted November 25, 2010 Author Share Posted November 25, 2010 ... Edit:Figured it out.Hey, just tested your code and it's working even if user hasn't local admin rights. :-)Now I will try to adapt the code into my script. It would be nice to get the results delivered in an array.Have to check how to manage this.Thanks alot :-)Markus Link to comment Share on other sites More sharing options...
UEZ Posted November 25, 2010 Share Posted November 25, 2010 Have a look here: Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now