Jump to content

export reg key for drive mapping


Recommended Posts

I'm trying to use AutoIt to export a reg key to remap drives after a PC is rebuilt, Here's the is the command line that I would like to build into an AutoIT script:

regedit /E c:\drives.reg "HKEY_CURRENT_USER\Network"

If you have any other ideas on how to do this that will be great as well.

Thanks in advance for any help

Link to comment
Share on other sites

You have many options.

RegWrite()

RegRead()

RunWait("reg EXPORT...")

RunWait("regedit /E...")

DriveMapAdd()

DriveMapDel()

DriveMapGet()

Thanks for the quick response !!!

I tried:

Func Drives()

RunWait("regedit /E c:\drives.reg "HKEY_CURRENT_USER\Network"")

EndFunc

And I get "unable to parse line" error

Link to comment
Share on other sites

You can't nest double quotes within double quotes. Use single quotes to surround your statement.

Thanks again..

I figured that out and got the reg key to save to the root of C, Now my last step is to copy it to the logined user desktop, this is what I tried, I did not get any errors, but the reg file did not copy, I'm sure it's something simple that I'm just over looking.

Func Drives()

RunWait("regedit /E c:\drives.reg HKEY_CURRENT_USER\Network")

FileCopy("c:\drives.reg", "%userprofile%/desktop/drives.reg")

I'm new to AutoIT and you guys have been great THANKS AGAIN !

Link to comment
Share on other sites

  • 2 weeks later...

You can't nest double quotes within double quotes. Use single quotes to surround your statement.

Yes, you can. Here is an example:

MsgBox( 0, "", "He said, ""You can't nest double quotes within double quotes.""  Then, I said ""Yes, you can.""" )

I produces this in a message box:

He said, "You can't nest double quotes within double quotes."  Then, I said "Yes, you can."
Link to comment
Share on other sites

  • 8 years later...
  • Moderators

Hi, @ADICorp welcome to the forum. To find out if this would work for your environment, I would suggest trying it yourself ;) 

There is also the DriveMapAdd and DriveMapDel functions in the help file that you can acquaint yourself with. I would suggest trying out the examples in the help file for yourself to see which will best fit your needs. If you get stuck, start a new thread and explain what you are trying to accomplish and what is not working, and we will do our best to assist :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Just now, JLogan3o13 said:

Hi, @ADICorp welcome to the forum. To find out if this would work for your environment, I would suggest trying it yourself ;) 

There is also the DriveMapAdd and DriveMapDel functions in the help file that you can acquaint yourself with. I would suggest trying out the examples in the help file for yourself to see which will best fit your needs. If you get stuck, start a new thread and explain what you are trying to accomplish and what is not working, and we will do our best to assist :)

Thank you for your reply so quickly.

I agree and am digging around the help files here and there when I get a chance. Trying to give myself a crash course.

I have taken what I see on this post, and tested it to no avail. I believe the issue is just me not understanding exactly what to do, but I will get it eventually and then will be able to go from there.

Thank you again

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...