Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script and file location

Status
Not open for further replies.

VRIT

IS-IT--Management
Sep 2, 2002
60
GB
Dear all,

I have writen a login script for my company and I am now at a stage were I need to test it on live users and groups. However I have run into a problem:

The script is part of a Group Policy, so when the policy was created it created a directory for anything to do with that policy. I placed the VBS file with that directory and it works without a problem. However within the script it references the existence of another file. This file needs to be held within the same folder. However since the network consists of 9 sites and the information is replicated to the other sites/servers I do not know how to reference the file from within the script.

Urgh. I hope that makes some sence.

Thanks in advance,

VRIT
 
Take a look at the WScript.ScriptFullName property and the FileSystem object to do something like this:
Code:
Set fso=CreateObject("Scripting.FileSystemObject")
Set f1=fso.GetFile(WScript.ScriptFullName)
WScript.Echo f1.ParentFolder

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top