Jump to content

Backup script


 Share

Recommended Posts

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.

Link to comment
Share on other sites

@ 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
Link to comment
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.

Link to comment
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
Link to comment
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
Link to comment
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...
Link to comment
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)
Link to comment
Share on other sites

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