adamsj13 Posted October 19, 2005 Share Posted October 19, 2005 Last question I hope for creating a backup script. How or can you captured all mapped drives and printers? Thanks Link to comment Share on other sites More sharing options...
Danny35d Posted October 19, 2005 Share Posted October 19, 2005 To get all network connections are store in this registry keyHKEY_Current_User\NetworkAnd all Network Printers are store in this other keyHKEY_Current_User\Printers\Connections AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
LxP Posted October 20, 2005 Share Posted October 20, 2005 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 More sharing options...
Danny35d Posted October 20, 2005 Share Posted October 20, 2005 (edited) @ LxPI 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 October 20, 2005 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
LxP Posted October 20, 2005 Share Posted October 20, 2005 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 More sharing options...
Danny35d Posted October 20, 2005 Share Posted October 20, 2005 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 More sharing options...
LxP Posted October 20, 2005 Share Posted October 20, 2005 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... Link to comment Share on other sites More sharing options...
adamsj13 Posted October 20, 2005 Author Share Posted October 20, 2005 To get all network connections are store in this registry keyHKEY_Current_User\NetworkAnd all Network Printers are store in this other keyHKEY_Current_User\Printers\ConnectionsWhat 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 More sharing options...
seandisanti Posted October 20, 2005 Share Posted October 20, 2005 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 More sharing options...
Danny35d Posted October 20, 2005 Share Posted October 20, 2005 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 Link to comment Share on other sites More sharing options...
seandisanti Posted October 20, 2005 Share Posted October 20, 2005 cameronsdadWhat 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... Link to comment Share on other sites More sharing options...
adamsj13 Posted October 20, 2005 Author Share Posted October 20, 2005 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" Link to comment Share on other sites More sharing options...
Danny35d Posted October 20, 2005 Share Posted October 20, 2005 (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 October 20, 2005 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now