Jump to content

adding .reg file to script


tachi
 Share

Recommended Posts

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

"" = one escaped " when within quotes

thanks, i am now running

C:\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

regsrv32 does not run in a cmd box (at least not on my system) so drop the comspec.

Try:

run('regsrv32 /s "' & $pathnameRegFile & '"')
Edited by Uten
Link to comment
Share on other sites

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

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

:P

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

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

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 by tachi
Link to comment
Share on other sites

  • 15 years later...

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

  • Developers
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...