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

Page 2 of 2 FirstFirst 12

  1. Posts : 3,788
    win 8 32 bit
       #11

    /s on regedit runs it silent so no need for user to do anything
      My Computer


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

    Thanks for everyone's input and suggestions.

    I'm familiar with the /S switch but unfortunately, it seems I can't import .reg files with any .cmd or .bat files.
    I've tried 'reg.exe import' and 'regedit /s' , nothing works except manually typing in cmd prompt or running the .reg files directly.

    I've never run into anything like this.

    I'll try to read\export key and see if that's possible.
    Last edited by KapaKai5O; 01 Nov 2017 at 16:55.
      My Computer


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

    Exporting is no problem - only importing or adding.
    Tried Reg ADD but it recreated main key (HKLM\Software\...... Run).
    Can't remember how to ADD via Reg.exe it's been that long.
    Only need to add the entry for auto running or not auto running a program with windows start.
    Import probably would work better for that? But ADD would allow direct input of value\data which works.

    Any ideas how to reg add when RUN key is already present?
      My Computer


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

    Just wanted to again thank everyone here for their input.
    Was able to knock the cobwebs out of my war torn brain and figure it out.
      My Computer


  5. Posts : 18
    Windows 10 x64
       #15

    KapaKai5O said:
    Was able to knock the cobwebs out of my war torn brain and figure it out.
    Please tell me how you did it.

    I am on the verge of just converting my .reg script to a .bat version and using reg add because importing the .reg file via .bat (using regedit /s) is not working. It applies fine if I manually run the reg file, but I am having the same problem you were having.

    EDIT: Found at Technet:

    Code:
    "ok, it's weird but I think I worked it out. Windows 7 won't merge
    a .reg file with regedit, reg or regedt32 at logon if the .reg file is
    on the network during logon. It works ok after logon, though.
    
    So, I changed our logon script to copy such files to %TEMP% and
    apply from there and now it works ok.
    
    I do often wonder why Microsoft do such things..."
    Code:
    https://social.technet.microsoft.com/Forums/windows/en-US/43b385b5-289d-49a0-92b5-7006fe6a612d/regeditexe-fails-to-merge-reg-files-during-user-logon?forum=w7itprogeneral
    I'll try doing xcopy to %TEMP% and see if it can be run from there.
    Last edited by 10Fan; 08 Jan 2020 at 13:34.
      My Computer


 
Page 2 of 2 FirstFirst 12

  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 16:29.
Find Us