Jump to content

rockinsmartguy

Member
  • Posts

    5
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About rockinsmartguy

rockinsmartguy's Achievements

0

Reputation

  1. I have to do this through a startup or shudown script through group policy, or through sms. I am not sure on how to call a script , amy sugestions will help.
  2. I am not using the batch file, I am using the vbs mentioned in my previous posts. The script works on a single pc but when I run it through a batch file it's not working thats the problem I am having.
  3. I am trying to delete a particular registry key(HKEY_CURRENT_USER\Software) in outlook for couple of hundred users in the domain. The script needs to run through group policy, I already wrote the script tested on a single pc but it's not running through login script.
  4. This is the script I have ============================================================ Const HKEY_CURRENT_USER = &H80000001 strComputer = CreateObject("Wscript.Shell").Environment("Process")("ComputerName") 'strComputer = "." Dim strKey strKey = "HKEY_CURRENT_USER\Software" If Not RegKeyExists(strKey) Then 'WScript.Echo "Key Is NOT Present!" Else 'WScript.Echo "Key IS Present." Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") strKeyPath = "Software\Microsoft\Windows NT" oReg.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubKeys For Each subkey In arrSubKeys 'Wscript.Echo strKeyPath & "\" & subkey oReg.DeleteKey HKEY_CURRENT_USER, strKeyPath & "\" & subkey Next 'Wscript.Echo strKeyPath oReg.Deletekey HKEY_CURRENT_USER, strKeyPath End If Function RegKeyExists(strName) Const NO_EXISTING_KEY = "HKEY_NO_EXISTING\Key\" Dim objWsh Dim strKeyPath Dim strNoKeyError Set objWsh = WScript.CreateObject("WScript.Shell") strKeyPath = Trim(strName) If Right(strKeyPath, 1) <> "\" Then strKeyPath = strKeyPath & "\" On Error Resume Next ' Get the error description by trying to read a non-existent key objWsh.RegRead NO_EXISTING_KEY strNoKeyError = Err.Description Err.Clear objWsh.RegRead strKeyPath ' Compare the error description with the previous determined sample If Replace(Err.Description, strKeyPath, NO_EXISTING_KEY) = strNoKeyError Then RegKeyExists = False Else RegKeyExists = True End If Err.Clear On Error Goto 0 Set objWsh = Nothing End Function =========================================================== The script runs on a single pc but its not working through login script, any examples on how to write a a reg file and run it through a batch file. is reg file going to delete all the subkeys below as they need to be empty before the main key gets deleted.
  5. I am trying to delete this registry key through a batch file which will run through group policy. Is there going to be permission issues with this . this is what I have so far @echo off REG DELETE HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676 /f cls This is the name of the key HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\00000003 What else I need in the batch file. Any other sugestions will help as isn't only HKLM,HKU available for running it on remote machine.
×
×
  • Create New...