nend Posted March 22, 2017 Posted March 22, 2017 (edited) Hi guys, What is wrong with this line? ShellExecuteWait("REG", "EXPORT HKCU\SOFTWARE\Nend Software\Tray Radio" & @ScriptDir & "\test.reg") I try to export a registry key but couldn't get this to work. Is this a safety issue from windows or do I use shellexecute the wrong way? Edited March 22, 2017 by nend
Subz Posted March 22, 2017 Posted March 22, 2017 Have you tried: Run(@ComSpec & " /c REG EXPORT HKCU\SOFTWARE\Nend Software\Tray Radio " & @ScriptDir & "\test.reg")
nend Posted March 22, 2017 Author Posted March 22, 2017 @Subz This gives exactly the same problem. The test.reg file hasn't been made.
Subz Posted March 22, 2017 Posted March 22, 2017 Sorry missed your space in the reg you need to use, something like this: Run(@ComSpec & ' /c REG EXPORT "HKCU\SOFTWARE\Nend Software\Tray Radio" "' & @ScriptDir & '\test.reg"') nend 1
ripdad Posted March 22, 2017 Posted March 22, 2017 (edited) ShellExecuteWait('REG', 'EXPORT "HKCU\SOFTWARE\Nend Software\Tray Radio" "' & @ScriptDir & '\test.reg"') You have to use double quotes in command lines when spaces are in it. Edited March 22, 2017 by ripdad nend 1 "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward
nend Posted March 22, 2017 Author Posted March 22, 2017 11 minutes ago, Subz said: Sorry missed your space in the reg you need to use, something like this: Run(@ComSpec & ' /c REG EXPORT "HKCU\SOFTWARE\Nend Software\Tray Radio" "' & @ScriptDir & '\test.reg"') This works fine, thanks
nend Posted March 22, 2017 Author Posted March 22, 2017 6 minutes ago, ripdad said: ShellExecuteWait('REG', 'EXPORT "HKCU\SOFTWARE\Nend Software\Tray Radio" "' & @ScriptDir & '\test.reg"') You have to use double quotes in command lines when spaces are in it. And this works also fine, thanks for your reply.
nend Posted March 22, 2017 Author Posted March 22, 2017 5 minutes ago, Subz said: Have you tried the RegFunc UDF, its a great UDF. I will look into that, thankd for the tip.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now