Jump to content

Cannot export a registry key that has a space in the name.


Recommended Posts

I have a reg key that contains a space in the reg name as seen in the first example. This key will not export whereas the second example

doees not have a space in the reg name, exports fine. Any help in getting the first example to export is appreciated.

ShellExecuteWait("regedit.exe","/e mykey2.reg HKEY_LOCAL_MACHINE\Software\my key2", "C:\backups\regkeys")

ShellExecuteWait("regedit.exe","/e mykey1.reg HKEY_LOCAL_MACHINE\Software\mykey1", "C:\backups\regkeys")
Link to post
Share on other sites

try doing this

ShellExecuteWait("regedit.exe","'/e mykey2.reg HKEY_LOCAL_MACHINESoftwaremy key2'", "C:backupsregkeys")

*edit*

When you have a space in a path, use single quotes (' ') inside the double quotes to keep the path from breaking up

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to post
Share on other sites

try doing this

ShellExecuteWait("regedit.exe","'/e mykey2.reg HKEY_LOCAL_MACHINESoftwaremy key2'", "C:backupsregkeys")

*edit*

When you have a space in a path, use single quotes (' ') inside the double quotes to keep the path from breaking up

That does not work...it prompts to add '/e to the registry..
Link to post
Share on other sites

Don't take peoples code blindly, read it and evaluate it yourself. The quotes are wrongly placed, and I don't know if Windows accepts single quotes like that, better to just use double quotes as it doesn't matter from AutoIts point of view.

I would expect this to work:

'/e mykey2.reg "HKEY_LOCAL_MACHINESoftwaremy key2"'
Edited by AdmiralAlkex
Link to post
Share on other sites

I've been trying all different combinations of quotes and testing them since my first reply was wrong. (usually I don't have any problems throwing quotes around things) but in this case, yours does not work either Admiral.

*edit*

Nevermind, I forgot to put the space back into the reg key when testing :oops:

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...