locked
vbs script to change process priority doesn't work on other users processes RRS feed

  • Question

  • Hi all,

    i'm fighting with a script that has to change priority of a process, it has effects only on processes of the owner, if i want to elevate priority of an istance of a process lauched by another user the script has no result, i run it as administrator, and only on administrator processes gives result

    Thanks in advance for help

    Const REAL_TIME = 256
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colProcesses = objWMIService.ExecQuery _
        ("Select * from Win32_Process Where Name = 'msaccess.exe' ")
    For Each objProcess in colProcesses
        objProcess.SetPriority(REAL_TIME)
    Next

    Tuesday, October 30, 2012 10:25 AM

Answers

  • Hi,

    Based on my understanding, what your enconter should be right, as only process owner have right to access his processes. Others will only could see his own process.

    In addition, for scripting issue, we should post in the scripting guys forum:

    The Official Scripting Guys Forum!

    http://social.technet.microsoft.com/Forums/en/ITCG/threads

    Regards,

    Yan Li


    Yan Li

    TechNet Community Support

    • Marked as answer by Yan Li_ Monday, November 5, 2012 1:52 AM
    Thursday, November 1, 2012 5:26 AM

All replies

  • Hi,

    Based on my understanding, what your enconter should be right, as only process owner have right to access his processes. Others will only could see his own process.

    In addition, for scripting issue, we should post in the scripting guys forum:

    The Official Scripting Guys Forum!

    http://social.technet.microsoft.com/Forums/en/ITCG/threads

    Regards,

    Yan Li


    Yan Li

    TechNet Community Support

    • Marked as answer by Yan Li_ Monday, November 5, 2012 1:52 AM
    Thursday, November 1, 2012 5:26 AM
  • Thanks for reply,

    i will try now in the scripting forum, i'm interested in automating this function because i have seen that i can do it manually, if i change priority to a process of another user as Administrator it works, if i do that by script no.

    Thanks again

    Matteo
    Monday, November 5, 2012 11:42 AM