Goodmorning everyone.
I'm actually mapping a virtual drive connecting to a share folder which all users have already accessed.
I'm, using the following simple code which work perfect for one user (C020411):
Dim objShell As Object
Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd.exe /c Subst J: ""C:\Users\C020411\OneDrive - Document\""", 0, True
Now, since this mapping is valid only for the user "C020411" (window username), I have to do it dynamically based on the window user. I have a function to get the window username named actNames(1) and I'm trying, in all ways, to use it in the connection string but so far i was not able to do it. I tried the following and others but i have difficulty to locate the " in the correct way.
objShell.Run "cmd.exe /c Subst J: ""C:\Users\" & actNames(1) & ""\OneDrive - Document\""", 0, True
Someone can kindly tell me how to use that variable actNames(1) in the string?
Thank you,
Cheers
I'm actually mapping a virtual drive connecting to a share folder which all users have already accessed.
I'm, using the following simple code which work perfect for one user (C020411):
Dim objShell As Object
Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd.exe /c Subst J: ""C:\Users\C020411\OneDrive - Document\""", 0, True
Now, since this mapping is valid only for the user "C020411" (window username), I have to do it dynamically based on the window user. I have a function to get the window username named actNames(1) and I'm trying, in all ways, to use it in the connection string but so far i was not able to do it. I tried the following and others but i have difficulty to locate the " in the correct way.
objShell.Run "cmd.exe /c Subst J: ""C:\Users\" & actNames(1) & ""\OneDrive - Document\""", 0, True
Someone can kindly tell me how to use that variable actNames(1) in the string?
Thank you,
Cheers