tachi Posted August 27, 2006 Share Posted August 27, 2006 Simple question realy, i have a .reg file with data i want to import into the registry, i have tryed running regsvr32 like this Run(@ComSpec & " /c " & "regsvr32 /s "&@ScriptDir&"\register.reg", "", @SW_HIDE) but it fails because the path is C:\WINDOWS\system32\cmd.exe /c regsvr32 /s C:\autoit work\register.reg and it needs to have ""'s around the C:\autoit work\register.reg because of the namespaces, how can i escape the ""''s in the run line so they are given to regsvr32 so it should look like this C:\WINDOWS\system32\cmd.exe /c regsvr32 /s "C:\autoit work\register.reg" thanks Link to comment Share on other sites More sharing options...
amanda089 Posted August 27, 2006 Share Posted August 27, 2006 "" = one escaped " when within quotes Link to comment Share on other sites More sharing options...
tachi Posted August 27, 2006 Author Share Posted August 27, 2006 "" = one escaped " when within quotesthanks, i am now runningC:\WINDOWS\system32\cmd.exe /c regsvr32 "C:\Autoit work\regkeyinfo.reg"and RegSvr32 thows "C:\Autoit work\regkeyinfo.reg" is not an executable file and no registration helper is registered for this file type.what am i doing wrong? Link to comment Share on other sites More sharing options...
Uten Posted August 27, 2006 Share Posted August 27, 2006 (edited) regsrv32 does not run in a cmd box (at least not on my system) so drop the comspec. Try: run('regsrv32 /s "' & $pathnameRegFile & '"') Edited August 27, 2006 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
tachi Posted August 27, 2006 Author Share Posted August 27, 2006 regsrv32 does not run in a cmd box (at least not on my system) so drop the comspec. Try: run('regsrv32 /s "' & $pathnameRegFile & '"') eargh, still dosent work even without using a cmd box, ive spent hours on this small little problem and grrrrrrr Link to comment Share on other sites More sharing options...
MHz Posted August 27, 2006 Share Posted August 27, 2006 A couple of examples RunWait('regsvr32 /s "C:\Autoit work\regkeyinfo.reg"') RunWait('regsvr32 /s "' & @ScriptDir & '\register.reg"') ; using a macro also can have spaces in path Link to comment Share on other sites More sharing options...
tachi Posted August 27, 2006 Author Share Posted August 27, 2006 A couple of examples RunWait('regsvr32 /s "C:\Autoit work\regkeyinfo.reg"') RunWait('regsvr32 /s "' & @ScriptDir & '\register.reg"') ; using a macro also can have spaces in path i tryed the second with the macro in, but its still saying "C:\Autoit work\regkeyinfo.reg" is not an executable file and no registration helper is registered for this file type. copyed and pasted from your reply,? Link to comment Share on other sites More sharing options...
MHz Posted August 27, 2006 Share Posted August 27, 2006 I wonder if you have an issue with your PATH variable. Try this RunWait(@SystemDir & '\regsvr32 /s "' & @ScriptDir & '\register.reg"') Link to comment Share on other sites More sharing options...
tachi Posted August 27, 2006 Author Share Posted August 27, 2006 I wonder if you have an issue with your PATH variable. Try this RunWait(@SystemDir & '\regsvr32 /s "' & @ScriptDir & '\register.reg"') still the same, ime takeing out the /s so i can see the error, else it just runs and i have to check the registry FYI, the key is an exported key from the same machine which i then delete to test if the script it working Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 27, 2006 Share Posted August 27, 2006 I have a giant question here. Isn't regsvr32 meant for registering COM components? If you want to merge a reg file with the Windows Registry, shouldn't you send the file to regedit then hit OK? I'm wondering also though, if AutoIt has registry editing capabilities, why not use them? Link to comment Share on other sites More sharing options...
MHz Posted August 27, 2006 Share Posted August 27, 2006 That makes perfect sense, Icekirby1. Caught up in copying code. RunWait('regedit /s "' & @ScriptDir & '\register.reg"') Now that should work. Link to comment Share on other sites More sharing options...
tachi Posted August 27, 2006 Author Share Posted August 27, 2006 (edited) That makes perfect sense, Icekirby1. Caught up in copying code. RunWait('regedit /s "' & @ScriptDir & '\register.reg"') Now that should work. heh yeah he is totaly right http://support.microsoft.com/kb/310516/ er, a big whoops on my part, was writeing batch files last week for DLL files and got mixed up thanks for your help guys, and er, sorry Edited August 27, 2006 by tachi Link to comment Share on other sites More sharing options...
NYCmitch25 Posted February 17, 2022 Share Posted February 17, 2022 FYI: Compile 64bit / run 64bit only I had this issue twice and forgot my solution to the problem both times, finally figured it out. This was on my Win10 64bit system. Hence, USE THE 64BIT COMPILE AND SCRIPT RUN DO NOT USE 32BIT or the registry entries will got into the WOW6432Node folder and will not work for a lot of things. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 18, 2022 Developers Share Posted February 18, 2022 11 hours ago, NYCmitch25 said: USE THE 64BIT COMPILE AND SCRIPT RUN DO NOT USE 32BIT or the registry entries will got into the WOW6432Node folder and will not work for a lot of things. That obviously depends on the reg file being imported ....and for the records.... you posted in a 15 years old topic. ..... and really do not see the relation other than it's about a reg file. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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