Import Reg File: cmd works - Reg\Regedit w/bat file doesn't work?

Page 1 of 2 12 LastLast

  1. Posts : 38
    Win 7 Pro 32bit
       #1

    Import Reg File: cmd works - Reg\Regedit w/bat file doesn't work?


    This is embarrassing but I've spent so many hours on it I feel I have no choice.
    I'm not real keen with Win 7 yet and I've done this with earlier os's without this problem.
    Can't figure out why it's not working here, and I see many others having similar questions.
    OS = Win7 Pro 32 bit.

    I'm used to keyboard\cmd prompt so it's not an issue for me, but I'm putting together a system
    for a friend who isn't that 'cmd prompt savvy'.

    I need to create simple batch files for deleting and importing reg value (hklm\software\xxxx\run).
    The program I'm trying to manage has no way to prevent auto running within it's gui
    so I have allow the user to do this manually.
    It's a FW so it's important to be able to manage it for troubleshooting etc.
    It can be temporarily disabled, but it's important to prevent it from auto running as well.

    When I run either 'reg.exe import autorun.reg', noautorun.reg' OR 'regedit /s autorun.reg' etc.,
    via command line from the folder the reg files are in, it works perfectly every time.
    But no matter how I create the bat files, they run with no prompt, no error(s) and do nothing.
    Even when run as admin.

    Can someone please explain what I am missing here?
    I've read in a very dated thread here where someone claimed it worked by adding:
    'rundll32.exe USER32.DLL, UpdatePerUserSysetmParameters ,1 ,True'
    but I don't recall ever having to do this with a simple reg file import or value deletion.

    I realize that Mark R's Autoruns would do the trick, but I need it to be a one click solution,
    so it's very simple for user.

    Thanks very much for any help on this!
      My Computer


  2. Posts : 3,788
    win 8 32 bit
       #2

    You should use the cmd regedit /s autorun.reg.

    Look a winpatrol that stops any new software adding to start it ask for permission to let it start it does so much more blocks virus from starting and lets you edit start very simply
      My Computer


  3. Posts : 38
    Win 7 Pro 32bit
    Thread Starter
       #3

    samuria said:
    You should use the cmd regedit /s autorun.reg.
    Thanks for the response.
    Are you implying that it's not possible to setup a batch file for this simple purpose with W7?
    As I wrote above, user is not wanting to type in cmd prompt.

    If that's the case, I'll have no choice but to create direct shortcuts to the reg files.
    And user will have to click ok on the warning every time reg file runs. I wanted to avoid that route.
    Look a winpatrol that stops any new software adding to start it ask for permission to let it start it does so much more blocks virus from starting and lets you edit start very simply
    ?????
      My Computer


  4. Posts : 3,788
    win 8 32 bit
       #4

    I gave you the code for batch file regedit /s autorun.reg
      My Computer


  5. Posts : 16,164
    7 X64
       #5

    I have no problem running regedit /s path_to_something.reg from a batch file.

    You have a strange issue, it seems.

    I see many others having similar questions.
    Where? Do you have links?
      My Computers


  6. Posts : 714
    Win 7 Pro, SP1, x86, Win-11/Pro/64
       #6

    If I'm going to add something to, or edit, my registry, I use a .reg script and NOT a batch file.

    That's much less problematical.

    Example of a Windows 7 registry tweak: file name, "Win-7 Performance Tweak.reg"

    Windows Registry Editor Version 5.00
    ; Shorten shutdown time. Time is in Milliseconds.
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control]
    "WaitToKillServiceTimeout"="1000"

    ; Load the Kernel into RAM on boot, for faster running.
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
    "DisablePagingExecutive"="1"
    "LargeSystemCache"="1"


    I have a whole library of such .reg scripts, that I use when setting up a new PC or tuning up an old one.

    Cheers Mates!
    TechnoMage
      My Computer


  7. Posts : 38
    Win 7 Pro 32bit
    Thread Starter
       #7

    samuria said:
    I gave you the code for batch file regedit /s autorun.reg
    Sorry, didn't understand. It's because that's exactly what I've been trying to do.
      My Computer


  8. Posts : 38
    Win 7 Pro 32bit
    Thread Starter
       #8

    Searching Reveals Plenty of People


    SIW2 said:
    I have no problem running regedit /s path_to_something.reg from a batch file.
    Is it possible you could post it?
    You have a strange issue, it seems. Where? Do you have links?
    Too many to post. I searched and found numerous references on stack overflow and others.
    Last edited by KapaKai5O; 01 Nov 2017 at 16:56.
      My Computer


  9. Posts : 38
    Win 7 Pro 32bit
    Thread Starter
       #9

    Could You Possibly Post One?


    TechnoMage2016 said:
    If I'm going to add something to, or edit, my registry, I use a .reg script and NOT a batch file.

    That's much less problematical.

    Example of a Windows 7 registry tweak: file name, "Win-7 Performance Tweak.reg"

    Windows Registry Editor Version 5.00
    ; Shorten shutdown time. Time is in Milliseconds.
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control]
    "WaitToKillServiceTimeout"="1000"

    ; Load the Kernel into RAM on boot, for faster running.
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
    "DisablePagingExecutive"="1"
    "LargeSystemCache"="1"


    I have a whole library of such .reg scripts, that I use when setting up a new PC or tuning up an old one.

    Cheers Mates!
    TechnoMage
    Could you possibly post ones to simply add & remove program from:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run ?

    I can create simple .reg files for this but again, user will need to ok for permission to run.
    Wouldn't scripts be the same? I'm trying to avoid user having to ok to run it.
    Sorry if I am not getting this, it's been quite awhile.

    Can't thank you enough for your help!
      My Computer


  10. Posts : 16,164
    7 X64
       #10

    From a huge .cmd file, here is a relevant section


    Code:
    @echo off
    SET TP=%~dp0
    SET TP=%TP:~0,-1%
    cd /d "%TP%"
    mode con lines=40 cols=100
    color 5f
    
     reg.exe import "BIN\REG64\VC90x64.reg" >nul
    
    pause
      My Computers


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:24.
Find Us