Posts: 1,058
Threads: 367
Joined: Oct 2007
To connect a network drive I call a DOS .bat file, which uses the dos-prompt command "net use z: \\147.......\abc" as it follows :
Function
ConnectNetDrive
if(RunConsole2("$my qm$\Files\Connect_Z.bat"))
,_s="Command failed, get advice fron QM output"
,min 0; err out "<>%s : <open ''%s /%i''>%s</open> - %s" NowT si _error.place si _s
,mac "Warning_QM" si 0
,end
I wonder whether it exists a QM callable function to do it in an elegant way.
Many thanks !
Posts: 12,055
Threads: 140
Joined: Dec 2002
Macro
Macro2037
Wsh.WshNetwork n._create
VARIANT v=1
n.MapNetworkDrive("N:" "\\x\y" v)
Macro
Macro2038
Wsh.WshNetwork n._create
VARIANT v=1
n.RemoveNetworkDrive("N:" v v)
A network drive mapping is for current user only. On Windows Vista and later, there are 2 users simultaneously - standard user and admin. If QM is running as admin, the mapping is visible only to QM and other admin programs, and therefore is not displayed in Windows Explorer. If QM is running as standard user (User or uiAccess), the mapping is not visible to admin programs; it's the same as when you map in Windows Explorer. It seems there is a registry setting to make it visible to admin and standard user:
http://www.winability.com/how-to-make-e ... rk-drives/
Posts: 1,058
Threads: 367
Joined: Oct 2007
Dear Gintaras,
Many thanks indeed, for an extremely helpful advice.
Best tregards,
Simos
Posts: 1,058
Threads: 367
Joined: Oct 2007
Dear Gintaras,
Could you please re-write MapNetworkDrive command using also (including) username and password of the connection to be mapped.
Many thanks, Best regards.
Posts: 12,055
Threads: 140
Joined: Dec 2002
Wsh.WshNetwork n._create
VARIANT updateProfile(1) userName("...") password("...")
n.MapNetworkDrive("N:" "\\x\y" updateProfile userName password)
not tested
Posts: 1,058
Threads: 367
Joined: Oct 2007
Dear Gintaras, Perfect after testing it successfully, Many thanks as usually !