Delete Remote .bak regedit keys of Remote Users

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
guide08
Posts: 1
Joined: 16 Oct 2014 04:51

Delete Remote .bak regedit keys of Remote Users

#1 Post by guide08 » 16 Oct 2014 04:56

I want to delete all *.bak regedit keys of remote users (for temp users) in XP and Win 7 machines.
Is it possible to do delete them bat file via psexec?

Thank you in advance :)

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Delete Remote .bak regedit keys of Remote Users

#2 Post by Squashman » 16 Oct 2014 06:39

The REG command looks to support Computer name so you might want to start there.

Code: Select all

H:\>reg delete /?

REG DELETE KeyName [/v ValueName | /ve | /va] [/f]

  KeyName    [\\Machine\]FullKey
    Machine  Name of remote machine - omitting defaults to the current machine.
             Only HKLM and HKU are available on remote machines.
    FullKey  ROOTKEY\SubKey
    ROOTKEY  [ HKLM | HKCU | HKCR | HKU | HKCC ]
    SubKey   The full name of a registry key under the selected ROOTKEY.

  ValueName  The value name, under the selected Key, to delete.
             When omitted, all subkeys and values under the Key are deleted.

  /ve        delete the value of empty value name (Default).

  /va        delete all values under this key.

  /f         Forces the deletion without prompt.

Examples:

  REG DELETE HKLM\Software\MyCo\MyApp\Timeout
    Deletes the registry key Timeout and its all subkeys and values

  REG DELETE \\ZODIAC\HKLM\Software\MyCo /v MTU
    Deletes the registry value MTU under MyCo on ZODIAC

Post Reply