murray654 Posted October 9, 2008 Posted October 9, 2008 Hi, I have the problem with a network drive being disconnected when I start work. I thought I would try use the remap drives function which I found here CODEFunc _Remap() $drv = DriveGetDrive("NETWORK") If @error Then Exit For $i = 1 to $drv[0] $share = DriveMapGet($drv[$i]) DriveMapDel($drv[$i]) DriveMapAdd($drv[$i], $share) Next EndFunc But it does not re-connect any of my network drives. Is there another way (using autoit) to reconnect or refresh my drives. Currently I have to double click on drives in My Computer to make them connect to the other computers. Until I do that some of my scripts dont run. In windows Scheduled Tasks, the scripts I have scheduled are reported as status: could not start. these are scripts that are located (as exe) on the remote computer. Searched these forums for hours, and can't find any other solutions to my problem. Any ideas? Best regards, Murray
November Posted October 9, 2008 Posted October 9, 2008 Hi there, This is a scratch code, try to get something from here. I didnt test it! Func _Remap() $drv = DriveGetDrive("NETWORK") If @error Then msgbox(64, "Error", " Drive Error : No Network Drives Found") For $i = 1 to $drv[0] checkdrive() Next EndFunc func checkdrive() $check = DriveStatus($drv[$i]) select case $check = "INVALID" Remapdrive() case $check = "UNKNOWN" msgbox(64, "Error", " Drive Error : " & $check) case $check = "READY" msgbox(64, "Error", " Drive Error : " & $check) case $check = "NOTREADY" msgbox(64, "Error", " Drive Error : " & $check) EndSelect EndFunc Func Remapdrive() DriveMapDel($drv[$i]) DriveMapAdd($drv[$i], $share) EndFunc Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
murray654 Posted October 9, 2008 Author Posted October 9, 2008 Hi there,This is a scratch code, try to get something from here. I didnt test it!CheersThanks for the inputDriveGetDrive("NETWORK") is empty I have 11 network drives, but the command fails to get any information on them, because they are disconnected?I am going to set the computer to do a reboot to refresh my drives. Maybe that will work. Kind regards,Murray
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