DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect a network drive with DIAdem 11.0 script command?

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

0 Kudos
Message 1 of 5
(4,695 Views)

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?  
0 Kudos
Message 2 of 5
(4,685 Views)

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?

0 Kudos
Message 3 of 5
(4,678 Views)

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?  
0 Kudos
Message 4 of 5
(4,674 Views)

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.

0 Kudos
Message 5 of 5
(4,655 Views)