locked
VB Script from User account RRS feed

  • Question

  • Please Help !

    I need to control the Diskprotect from a user account.

    My C++ program must update itself when it finds a update file on the network.

     

    The Scripts to set the Dsik Protect to: "Remove all changes at restart" & "Retain all changes permanently" work perfectly when I am logged in as the Administrator, but when I run them from the (restricted) user account a error "access denied" is displayed when the "objWdp.Put_" command is executed.

     

    How to run this script from a restricted user account ???

     

    ' Identify the computer to manage
    strComputer= "."
          
    set objWbemServices = GetObject ("winmgmts:\\" & strComputer & "\root\wmi")
    set setWdpObjects   = objWbemServices.ExecQuery ("SELECT * FROM WDP_Control")

    for each objWdp in setWdpObjects
       objWdp.CurrentMode  = 0
       objWdp.Put_
    next


    ' Query again to get current Mode

    set objWbemServices = GetObject ("winmgmts:\\" & strComputer & "\root\wmi")
    set setWdpObjects   = objWbemServices.ExecQuery ("SELECT * FROM WDP_Control")

    for each objWdp in setWdpObjects
       Status = objWdp.CurrentMode
    next

    WScript.Quit Status

    Thursday, July 10, 2008 1:07 PM

Answers

  •  

    Hi, from the error message "access denied" and symptom, we can consider the issue is permission related. If the restricted standard user cannot run the scripts with this error message, we may need to convert it to restricted administrator user.

    Monday, July 14, 2008 3:43 AM