Sign in to follow this  
Followers 0
adamsj13

Backup script

13 posts in this topic

Last question I hope for creating a backup script. How or can you captured all mapped drives and printers? Thanks

Share this post


Link to post
Share on other sites



To get all network connections are store in this registry key

HKEY_Current_User\Network

And all Network Printers are store in this other key

HKEY_Current_User\Printers\Connections


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

I believe you can also use DriveGetDrive('NETWORK') to get a list of mapped drives. DriveMapGet() will give you information on the network share attached to a mapped drive.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@ LxP

I believe you can also use DriveGetDrive('NETWORK') to get a list of mapped drives. DriveMapGet() will give you information on the network share attached to a mapped drive.

I try to used those two function for a backup script that I did for my work and the only problem is that it give me all network connection, when actually the only network connection that we care are the persistent connection. That is why I take the network connection from the above registry key.

Do you know any other way to get just the persistent network connection?

Edited by Danny35d

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

As far as I know, there isn't any other way to find that information. I just thought I'd share the DriveGetDrive() approach however because the original poster didn't state that s/he was only interested in persistent connections.

Share this post


Link to post
Share on other sites

Lxp Thanks for the information I just used the same post trying to find out if anybody knows how to get just the persistent connection. In my backup script I used your _RegClone() to clone the registry key from the old computer to the new computer over the network and work really good. I was wondering if for any change did you have these function working _regFind() and _regReplace().


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

Thanks for reminding me! I have not written those functions yet but in about a month's time I'll have finished exams. I should look into doing those perhaps...

Share this post


Link to post
Share on other sites

To get all network connections are store in this registry key

HKEY_Current_User\Network

And all Network Printers are store in this other key

HKEY_Current_User\Printers\Connections

What is the easiest way to copy these 2 keys that will do it behind the scenes? Thanks all for your help

Share this post


Link to post
Share on other sites

Thanks for reminding me! I have not written those functions yet but in about a month's time I'll have finished exams. I should look into doing those perhaps...

could you attach your .au3 for _RegClone() ? i tried copying it from the thread linked in your sig, but for whatever reason it's not copying right...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

cameronsdad

What I did to copy _RegClone(), I copy and paste the script into wordpad then I copy and paste from wordpad to SciTe and then run Tidy or press Ctrl + T


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

cameronsdad

What I did to copy _RegClone(), I copy and paste the script into wordpad then I copy and paste from wordpad to SciTe and then run Tidy or press Ctrl + T

thanks, normally i have no problem copying from code boxes, so i just figured today was my day to be retarded... B)

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Is there a quick way to code this? It is a batch file I made, but would rather have it in a script

reg import HKEY_Current_User\Network "h:\mapped drives.reg"

reg import HKEY_Current_User\Printers\Connections "h:\PRINTERS.reg"

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Try using these lines to Export those registry key:

runwait(@comspec & " /c " & 'REGEDIT /E ' & 'h:\MappedDrives.reg "HKEY_CURRENT_USER\Network\"', "" ,@SW_HIDE)
runwait(@comspec & " /c " & 'REGEDIT /E ' & 'h:\Printers.reg "HKEY_CURRENT_USER\Printers\Connections\"', "" ,@SW_HIDE)

And then use these lines to Import those registry key back into the new computer:

runwait(@comspec & " /c " & 'REGEDIT /S ' & 'h:\MappedDrives.reg', "" ,@SW_HIDE)
runwait(@comspec & " /c " & 'REGEDIT /S ' & 'h:\Printers.reg', "" ,@SW_HIDE)

Note: I did not use H:\mapped drives.reg instep I use H:\MappedDrives.reg avoid using name with espace between them....

I used REGEDIT because Win2k don't have REG.EXE by default you have to installed

Hope this will help you...

Edited by Danny35d

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

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
Sign in to follow this  
Followers 0