vbscript - VB Using "Runas" -


I'm getting a cat of a time some syntax right here.

I have a small VB script that prompts for credentials and then uses authentication to run another VB script:

  set objShell = WScript.CreateObject ("WScript.Shell") strAdminName = InputBox ("What is your username (domain \ username)" objShell.Run "runas / user:" & amp; StrAdminName & amp; "" "Wscript.exe \\ xxx.xx.xxx \ DFS \ Tumw-IS \ Juniper Tools and Utilities \ Juniper Removal Tool \ delete_folders.vbs" " 

When I run the script Everything works, except that the script that I am calling can not be found. I find an error saying "There is no file extension in" \ xxx.xx.xxx \ DFS \ tumw-is \ Juniper. Obviously the problem lies in the fact that the location is in the location of the file And also that I am using the DFS link. When I run it and target the VBS file then there is no free space in the location, so it works fine.

I Can not get syntax for handling DFS link only

Thanks

- I think it is very easy, but I can not get it to work. John

Try this:

  objShell.Run "runas / user:" & strAdminName & Amp; " "Wscript.exe \" "\\ xxx.xx.xxx \ DFS \ Tumw-IS \ Juniper Tools and Utilities \ Juniper Removal Tool \ delete_folders.vbs \" "" " 

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -