BZU Posted May 12, 2008 Posted May 12, 2008 hi, i have running two processes running with the same name from different locations. how can i get process id from the desired location of process. how can i kill a system process which is running from user . like : if process name is SMSS.EXE then windows will disallow to kill it. how can i kill it because ProcessClose fails to kill it. please help me in this situation. thanx OS: Windows XP SP2, AutoIt version: 3.2.10.0Help The Great Forum Which is Used by You For Help.01 - Always Respect The Forum Members.02 - Use Search Before Posting or making any new Thread.03 - Help The Newbies.
BrettF Posted May 12, 2008 Posted May 12, 2008 Windows errors related to smss.exe? smss.exe is a process which is a part of the Microsoft Windows Operating System. It is called the Session Manager Subsystem and is responsible for handling sessions on your system. This program is important for the stable and secure running of your computer and should not be terminated. Better have a good reason for closing it... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
ChrisL Posted May 12, 2008 Posted May 12, 2008 hi, i have running two processes running with the same name from different locations. how can i get process id from the desired location of process. I think Larry wrote this a while ago Func _ProcessGetLocation($iPID) Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID) If $aProc[0] = 0 Then Return SetError(1, 0, '') Local $vStruct = DllStructCreate('int[1024]') DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0) Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048) If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '') Return '"' & FileGetLongName ( $aReturn[3] ) & '"' EndFunc You would use it in conjunction with ProcessList() to get the desired duplicated process names to PID [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
BZU Posted May 13, 2008 Author Posted May 13, 2008 not helpfull OS: Windows XP SP2, AutoIt version: 3.2.10.0Help The Great Forum Which is Used by You For Help.01 - Always Respect The Forum Members.02 - Use Search Before Posting or making any new Thread.03 - Help The Newbies.
ChrisL Posted May 13, 2008 Posted May 13, 2008 not helpfullHow the F**K do you come to that conclusion?I have provided you with a function which supplies the path from a PID.You use ProcessList() to get an array of processes and you loop through the array until you find the process name you want. Then you pass the PID to the supplied function to get the path of the PID.Still looks like you don't need anymore help anyway [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
JSunn Posted May 13, 2008 Posted May 13, 2008 not helpfull #include <WinAPI.au3> ;Close existing process with the same, but not the parent. $parent = _WinAPI_GetCurrentProcessID();get the parent process ID $procArr = ProcessList (@Scriptname) ;Loop through and kill any processes of the same name but without the same PID as the parent. For $i = 1 to Ubound($procArr) - 1 If $procArr[$i][1] <> $parent then ProcessClose($procArr[$i][0]) Next By the way, no one here is required to offer you help. Especially if you're rude. Think about that the next time you ask. -John
ChrisL Posted May 13, 2008 Posted May 13, 2008 By the way, no one here is required to offer you help. Especially if you're rude. Think about that the next time you ask.-JohnThe ironic thing is have you read his signature [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
JSunn Posted May 13, 2008 Posted May 13, 2008 The ironic thing is have you read his signatureYeah I noticed that just after posting. Good Stuff.
BrettF Posted May 14, 2008 Posted May 14, 2008 LMAO. So far he is breaking rule #1. And we are trying with #3. And don't think he tried #2, or pressed search, and didn't look at the results.... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
BZU Posted May 14, 2008 Author Posted May 14, 2008 ok , now i have got it. thanks for the help! OS: Windows XP SP2, AutoIt version: 3.2.10.0Help The Great Forum Which is Used by You For Help.01 - Always Respect The Forum Members.02 - Use Search Before Posting or making any new Thread.03 - Help The Newbies.
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