Hi,
I am trying to load the default user profile with reg.exe and then apply a registry key. But I get a failure on applying the key. The hive is loading properly.
set-variable -name arr_Prog1 -visibility public -Scope Script-Value @(
“Execute-Process -Path “reg.exe
” -Parameters “load HKU\ntuser.dat $env:SYSTEMDRIVE\users\default\ntuser.dat
””, "Execute-Process -Path <code>"reg.exe</code>" -Parameters <code>"ADD</code>"HKU\ntuser.dat\SOFTWARE\Microsoft\Internet Explorer\Main<code>" /v</code>"Start Page<code>" /t REG_SZ /d</code>"http://www.intranet.xxxxxx/<code>" /f</code>"",
“Execute-Process -Path “reg.exe
” -Parameters “unload
””`
)
And then calling it from:
<pre><code> foreach ( $Itemarr_Prog1 in $arr_Prog1 ) {
invoke-expression $Itemarr_Prog1
} </code></pre>
So the defaultuser.dat is loading successfully. But I get a failure while applying the registry key.
So the commandline:
Execute-Process -Path "reg.exe" -Parameters "ADD "HKU\ntuser.dat\SOFTWARE\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d "http://www.intranet.education/" /f"
Is failing. What is incorrect in my command line or then creating the array?
Thanks,
François