roboman

export reg key for drive mapping

12 posts in this topic

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

Share this post


Link to post
Share on other sites



You have many options.

RegWrite()

RegRead()

RunWait("reg EXPORT...")

RunWait("regedit /E...")

DriveMapAdd()

DriveMapDel()

DriveMapGet()

Share this post


Link to post
Share on other sites

You have many options.

RegWrite()

RegRead()

RunWait("reg EXPORT...")

RunWait("regedit /E...")

DriveMapAdd()

DriveMapDel()

DriveMapGet()

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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 !

Share this post


Link to post
Share on other sites

FileCopy("c:\drives.reg", @DesktopDir & "\drives.reg")

Share this post


Link to post
Share on other sites

FileCopy("c:\drives.reg", @DesktopDir & "\drives.reg")

You guys Rock !! Thanks

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Apologies for reviving a dead post, but does this work with newer versions of windows? (7,8,10)

Have never used Autoit and would find this particular script very useful.

 

Thank you

Share this post


Link to post
Share on other sites

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 :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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

Share this post


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