I have a vbscript file I need users to run from their laptop, the users are part of the domain but their laptops are not, so the users must first log in.
I’m running two scripts, one the get the user credentials and run the script. The other, well is the script. Problem: Each user could save the scripts in different folders on their laptops so I have to use absolute path. That’s where I’m having a problem. Here is the script.
Can someone please help?
'folderName = "..\.."
dim fso: set fso = CreateObject("Scripting.FileSystemObject")
' directory in which this script is currently running
CurrentDirectory = fso.GetAbsolutePathName(".")
'to use this to build a new path, you can use the BuildPath() function
NewPath = fso.BuildPath(CurrentDirectory, "SetPrintChkFst.vbs") ‘Name of file to run-this part ‘works. **********************
WScript.Echo("The file " & NewPath & " exist")
WScript.Echo("The file " & NewPath & " cannot be found")
set objShell = WScript.CreateObject("WScript.Shell")
strUserName = inputBox("What is your username (domain\username)")