nend Posted March 22, 2017 Share 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 Link to comment Share on other sites More sharing options...
Subz Posted March 22, 2017 Share Posted March 22, 2017 Have you tried: Run(@ComSpec & " /c REG EXPORT HKCU\SOFTWARE\Nend Software\Tray Radio " & @ScriptDir & "\test.reg") Link to comment Share on other sites More sharing options...
nend Posted March 22, 2017 Author Share Posted March 22, 2017 @Subz This gives exactly the same problem. The test.reg file hasn't been made. Link to comment Share on other sites More sharing options...
Subz Posted March 22, 2017 Share 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 Link to comment Share on other sites More sharing options...
ripdad Posted March 22, 2017 Share 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 Link to comment Share on other sites More sharing options...
Subz Posted March 22, 2017 Share Posted March 22, 2017 Have you tried the RegFunc UDF, its a great UDF. Link to comment Share on other sites More sharing options...
nend Posted March 22, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
nend Posted March 22, 2017 Author Share 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. Link to comment Share on other sites More sharing options...
nend Posted March 22, 2017 Author Share 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. Link to comment Share on other sites More sharing options...
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