Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
To connect a network drive
#1
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
Code:
Copy      Help
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 !
#2
Macro Macro2037
Code:
Copy      Help
Wsh.WshNetwork n._create
VARIANT v=1
n.MapNetworkDrive("N:" "\\x\y" v)
Macro Macro2038
Code:
Copy      Help
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/
#3
Dear Gintaras,

Many thanks indeed, for an extremely helpful advice.

Best tregards,
Simos
#4
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.
#5
Code:
Copy      Help
Wsh.WshNetwork n._create
VARIANT updateProfile(1) userName("...") password("...")
n.MapNetworkDrive("N:" "\\x\y" updateProfile userName password)
not tested
#6
Dear Gintaras, Perfect after testing it successfully, Many thanks as usually !


Forum Jump:


Users browsing this thread: 1 Guest(s)