Windows 10: Import reg file in a batch file

Page 1 of 2 12 LastLast
  1.    05 Jul 2018 #1

    Import reg file in a batch file


    Hi, i've a reg file to mod windows 10 that works properly, but if i import it in a batch file it doesn't work.
    this is the reg file i've called Windows10.reg
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons]
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu]
    ; Cartella utente
    "{59031a47-3f72-44a7-89c5-5595fe6b30ee}"=dword:00000000
    ; Computer
    "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
    ; Rete
    "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}"=dword:00000000
    ; Cestino
    "{645FF040-5081-101B-9F08-00AA002F954E}"=dword:00000000
    ; Pannello di controllo
    "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}"=dword:00000001
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
    ; Cartella utente
    "{59031a47-3f72-44a7-89c5-5595fe6b30ee}"=dword:00000000
    ; Computer
    "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
    ; Rete
    "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}"=dword:00000000
    ; Cestino
    "{645FF040-5081-101B-9F08-00AA002F954E}"=dword:00000000
    ; Pannello di controllo
    "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}"=dword:00000001
    
    ; Cortana Disabilita
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]
    "AllowCortana"=dword:00000000
    
    ; Smartscreen Disabilita
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer]
    "SmartScreenEnabled"="Off"
    
    ; Defender Disabilita
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender]
    "DisableAntiSpyware"=dword:00000001
    
    ; Onedrive Disabilita
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive]
    "DisableFileSyncNGSC"=dword:00000001
    
    ; Icona Contatti Disabilita
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People]
    "PeopleBand"=dword:00000000
    If i import it in a batch file called Windows10.cmd which run the reg and force the Explorer refresh to apply it
    Code:
    reg import Windows10.reg
    taskkill /f /im explorer.exe
    start explorer.exe
    some features don't work (for example Cortana is not disabled).
    Can you help me to understand where is the problem?
    Thank you
      My ComputerSystem Spec

  2. f14tomcat's Avatar
    Posts : 37,016
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       05 Jul 2018 #2

    jinkazama said: View Post
    Hi, i've a reg file to mod windows 10 that works properly, but if i import it in a batch file it doesn't work.
    this is the reg file i've called Windows10.reg
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons]
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu]
    ; Cartella utente
    "{59031a47-3f72-44a7-89c5-5595fe6b30ee}"=dword:00000000
    ; Computer
    "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
    ; Rete
    "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}"=dword:00000000
    ; Cestino
    "{645FF040-5081-101B-9F08-00AA002F954E}"=dword:00000000
    ; Pannello di controllo
    "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}"=dword:00000001
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
    ; Cartella utente
    "{59031a47-3f72-44a7-89c5-5595fe6b30ee}"=dword:00000000
    ; Computer
    "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
    ; Rete
    "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}"=dword:00000000
    ; Cestino
    "{645FF040-5081-101B-9F08-00AA002F954E}"=dword:00000000
    ; Pannello di controllo
    "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}"=dword:00000001
    
    ; Cortana Disabilita
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]
    "AllowCortana"=dword:00000000
    
    ; Smartscreen Disabilita
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer]
    "SmartScreenEnabled"="Off"
    
    ; Defender Disabilita
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender]
    "DisableAntiSpyware"=dword:00000001
    
    ; Onedrive Disabilita
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive]
    "DisableFileSyncNGSC"=dword:00000001
    
    ; Icona Contatti Disabilita
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People]
    "PeopleBand"=dword:00000000
    If i import it in a batch file called Windows10.cmd which run the reg and force the Explorer refresh to apply it
    Code:
    reg import Windows10.reg
    taskkill /f /im explorer.exe
    start explorer.exe
    some features don't work (for example Cortana is not disabled).
    Can you help me to understand where is the problem?
    Thank you
    @jinkazama

    You may need to run your batch file (.cmd) as Administrator. Right click it, and Run as Admin.
      My ComputersSystem Spec

  3.    05 Jul 2018 #3

    i've tried to run it as admin but nothing change, i attach an image to show the problem
    Attached Thumbnails Attached Thumbnails Cattura.jpg  
      My ComputerSystem Spec

  4. f14tomcat's Avatar
    Posts : 37,016
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       05 Jul 2018 #4

    jinkazama said: View Post
    i've tried to run it as admin but nothing change, i attach an image to show the problem
    That's just the default Search icon. If you disable Cortana, you still get the generic "Search". Just like the one you see if you right-click the Start Button. It's fine.
      My ComputersSystem Spec

  5.    05 Jul 2018 #5

    but the reg imported in batch file do not disable cortana
      My ComputerSystem Spec

  6. f14tomcat's Avatar
    Posts : 37,016
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       05 Jul 2018 #6

    jinkazama said: View Post
    but the reg imported in batch file do not disable cortana
    Have you looked at the tutorial here on Tenforums for disabling Cortana? It may help.....

    Enable or Disable Cortana in Windows 10 | Windows 10 Tutorials
      My ComputersSystem Spec

  7.    05 Jul 2018 #7

    Some changes to the registry can't be made even when running as administrator. More than likely that's one of them.
      My ComputerSystem Spec


  8. Posts : 924
    Windows 10 Home x64 and Pro x86
       05 Jul 2018 #8

    In the hope of being helpful to all -

    jinkazama said: View Post
    i've tried to run it as admin but nothing change, i attach an image to show the problem
    This diagram seems to have been misinterpreted by the other posters. The diagram, if I understand it correctly, shows that
    1 [left-hand side] Running the change using a batch file to import the relevant Registry keys fails to disable Cortana and hence the Taskbar still shows the Cortana icon.
    2 [right-hand side] Running the change using a Reg file to import the relevant Registry keys successfully disables Cortana and hence the Taskbar shows the Search icon.

    Whatever the OP's problem is, it is something to do with how the batch file reg import command operates.
    - The OP has dealt with the possibility that Admin permissions are to blame.
    - The OP has dealt with the possibility that the wrong Registry key settings are being addressed.
    - The OP has dealt with the possibility that there is some permissions problem affecting the Registry keys concerned. Those keys can most definitely be changed.

    Denis
      My ComputerSystem Spec

  9. f14tomcat's Avatar
    Posts : 37,016
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       05 Jul 2018 #9

    I see, yes, misinterpreted. Off the OP's topic of how to make the CMD work...

    If the .reg works just fine, and the .cmd does not for as yet unknown reasons....why not just use the .reg? How many times does this need to be done?

    Not meaning to sound frivolous, but is this now simply an academic exercise?
      My ComputersSystem Spec


  10. Posts : 924
    Windows 10 Home x64 and Pro x86
       05 Jul 2018 #10

    jinkazama said: View Post
    but the reg imported in batch file do not disable cortana
    I suggest that, as a first step, you edit the batch file so it captures the errorlevel after the reg import command.

    - Something simple such as
    echo The reg import command result is - %ErrorLevel%
    will do as long as long as you put it in as the line straight after the reg import command and then put a
    Pause
    command in as the next line [before restarting explorer] so you can have a look.

    - Checking the errorlevel will tell you whether reg import thinks it has completed correctly or not.
    - While you are checking the errorlevel you could also go to the Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search] to see what has happened to it [make sure you Refresh the view if you were already at that key beforehand]



    I have never used reg import but I know there are optional arguments for 32/64 bit items so perhaps you might investigate them
    - enter reg import /? >RegImport.txt in a command prompt to save the Help guidance that mentions these switches.
    - I do not think these switches are relevant but I have never investigated their use properly.
    - For all I know, the problem might be as simple as reg import not being able to handle the comment lines, such as ; Cartella utente, properly

    Best of luck,
    Denis
    Last edited by Try3; 05 Jul 2018 at 13:22.
      My ComputerSystem Spec


 
Page 1 of 2 12 LastLast

Related Threads
How can I add to this batch command to include the date: xcopy C:\all\* Z:\Allbak\* /E /Y /C I'd like the resulting file to be named "Z:\Allbak171129" (yr mo day). The plan is to set up a task schedule to run the batch file every week. I...
Need help with batch file in General Support
No serious Batch file or scripting experience, so bear with me. We use a site for our business that has to run on IE and has to have the cache cleared a certain way sometimes for it to function. We have to go IE options, uncheck delete history on...
autorun batch file usb in General Support
I want run a bat file from usb stick while inserting it plz help me
Batch File Help in Software and Apps
I've never dabbled much in batch files, as I've usually been able to find pre-made ones to do what I wanted. We have an application that handles user data backups. It has three services, and at times, one or two of the three don't start...
Hi there forum, how do you change the Visual effects using a batch file or registry file. Thanks, Edward.
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

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