Add a folder to the registry with a d-word value (with a space) from DOS using Altiris

Today I was struggling to get a Command Prompt box, sent by Altiris, to run a PowerShell command with a space in it. Finally I got it fixed.

The command is:


powershell.exe -command “& New-Item -path Registry::’HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppSrv'”



powershell.exe -command “& New-ItemProperty Registry::’HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppSrv’ -Name “TSMSI” -Value 0 -PropertyType “DWord””


Can’t get the solution to work? Contact me and let me do the trick.




This entry was posted in Scripts. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s