+ Post New Thread
Results 1 to 4 of 4
Windows Thread, Deleting a registry file on login in Technical; Hi everyone, At the moment we have a problem with the students rotating the screens using hot keys even though ...
  1. #1
    Unvalidated User
    Join Date
    Apr 2008
    Location
    thetford
    Posts
    41
    Thank Post
    6
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Deleting a registry file on login

    Hi everyone,

    At the moment we have a problem with the students rotating the screens using hot keys even though hotkeys are disabled.

    I have managed t find the registry file for this and found deleting that works.

    The only problem is with so many machines, and so little time to get in the rooms its a very long winded process to delete it from every machine.

    I am trying to figure out what line of code I can put in the logon script to delete it when it starts up, but so far am having no luck.

    Can anyone help me????

    The path to the registry file is HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\Curr entVersion\RUN\HotKeysCmds

  2. #2

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    65
    If you're using batch files for login scripts, the REG DELETE command is what you're after...

    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 <no name>
    /va delete all values under this key
    /f Forces the deletion without propmt

    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
    I always get confused as to whether a login script runs under user rights or machine rights though, so wouldn't expect it to delete a HKLM key successfully? You could always run this in a batch file from your admin machine with the machine names to be fixed listed - it supports remote key deletion.

  3. #3

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,568 Times in 1,250 Posts
    Rep Power
    340
    This is quite simple to do:

    Export a copy of the Run folder from the registry, then open it up in notepad. Using this example, I created a string value called "Test".

    Windows Registry Editor Version 5.00

    Code:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
    "TEST"=-
    After the equals sign, delete anything after it and insert a minus sign. Save the file and place it within your NETLOGON share.

    Within your script, enter this line:

    Code:
    regedit /s \\SERVERNAME\NETLOGON\REG_FILE.REG
    On a test machine, create a secondary backup of the Run folder, then try manually running the reg file. If it works, then place the above line of code in logon or startup scripts.

  4. Thanks to Michael from:

    notalot (10th June 2009)

  5. #4
    IrritableTech's Avatar
    Join Date
    Nov 2007
    Location
    West Yorkshire
    Posts
    792
    Thank Post
    83
    Thanked 171 Times in 140 Posts
    Rep Power
    64
    I did the same thing a couple of weeks ago using the method Michael outlined. I also disabled the tray icon.

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Run]
    "IgfxTray"=-

  6. Thanks to IrritableTech from:

    notalot (10th June 2009)

SHARE:
+ Post New Thread

Similar Threads

  1. Getting a batch file to react to a registry key
    By Wheelgunr in forum Windows
    Replies: 5
    Last Post: 12th September 2008, 05:23 PM
  2. Replies: 10
    Last Post: 5th September 2008, 11:29 AM
  3. File/Folder deleting and moving
    By Stumpy in forum How do you do....it?
    Replies: 3
    Last Post: 7th July 2008, 05:19 PM
  4. registry problem
    By david12345 in forum Windows
    Replies: 5
    Last Post: 21st March 2008, 09:14 AM
  5. Batch file to remove registry key doesnt work
    By sidewinder in forum Windows
    Replies: 4
    Last Post: 7th December 2007, 04:48 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •