Windows 10 kiosk- Scripting registry change for shell (reg add) using a value with quotes?

His Boy Elroy 26 Reputation points
2021-01-28T21:18:55.133+00:00

We are building a Windows 10 kiosk that switches the shell from explorer.exe to Google Chrome with a specified path to a web page. I need to switch the value of "Shell", pointing it to the Chrome executable with some switches.

I wanted to use a batch file with a "reg add" command, but I am running into problems because the data value includes quotes. Here is an example of the reg add command I am trying to run:

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "c:\Program Files (x86)\Google\Chrome\Application\Chrome.exe" --no-default-browser-check --kiosk http://Servername/Folder/index.html /f

It tells me "Invalid Syntax", I think because it thinks I want to change the data value to the value in quotes (c:\Program Files (x86)\Google\Chrome\Application\Chrome.exe) and it doesn't know what to do with the switches (--no-default-browser-check --kiosk http://Servername/Folder/index.html)

Is there a way for me to use the reg add command to do this? And if not, is there a better way to accomplish this? I am not a PowerShell expert but is there an equivalent PowerShell command that would work in this scenario?

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 36,291 Reputation points
    2021-01-29T02:49:06.473+00:00

    Try this.

    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d """"c:\Program Files (x86)\Google\Chrome\Application\Chrome.exe""" --no-default-browser-check --kiosk http://Servername/Folder/index.html" /f
    
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2021-01-29T10:05:51.18+00:00

    Hi,

    See if this works

    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "c:\Program Files (x86)\Google\Chrome\Application\Chrome.exe --no-default-browser-check --kiosk http://Servername/Folder/index.html" /f  
    

    Or you can use the powershell cmdlet Set-ItemProperty

    Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'Shell' -Value 'c:\Program Files (x86)\Google\Chrome\Application\Chrome.exe --no-default-browser-check --kiosk http://Servername/Folder/index.html'  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.