01-21-2009 03:44 AM
Hi,
I want to save measuring data with a DIAdem 11.0 script automaticaly to a network drive. In case that this network drive is not reachable/connected, I like to connect it with a script command line. Unfortunaly I couldn't find any usable commands for that yet.
Would be wonderful, if somebody could help!
Greetings
Sven
01-21-2009 10:15 AM
Hello Sven!
You have to use the Windows Scripting Object 'WshNetwork'. Example:
Dim oNetwork Set oNetwork = CreateObject("WScript.Network") Call oNetwork.MapNetworkDrive( "M:", "\\myserver\myfolder")
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
01-21-2009 01:18 PM
Hi Matthias,
thats great! Thanks for help, it works pretty good! But one problem more occurs now:
The network drive is a NAS system, what usually request connection using a login window. I can set the username and password to nothing, but when I connect this drive in Windows explorer, the NAS still need me to confirm the login dialog even without enter any username or password. After doing that the network drive will be mapped.
When I try to connect the drive using your commands I get no login dialog, but an error window with following content (translated from german):
The system has realised a possible safety risk. Please make sure that you are allowed to connect to the server who has authentificated you.
I'm pretty sure, that comes from login procedure of NAS. Again, there is no login window as in explorer, only the message above. Is it possible to include login information in the script to get connected automatically?
01-21-2009 02:43 PM
Hello Sven!
You can add the parameters to the call. The complete syntax of 'MapNetworkDrive' is:
MapNetworkDrive(strLocalName, strRemoteName, [bUpdateProfile], [strUser], [strPassword])
See Microsoft website for detailed infos of the parameters.
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
01-22-2009 03:14 AM
Hi Matthias,
thanks again for helping! That works! Sometimes there are problems with access delays to the mapped network drive, but generally it works fine.