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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse ScriptFullName to check the location.. 2

Status
Not open for further replies.

smcc12

Programmer
Jan 8, 2009
17
US
I am trying to write a check into a script that makes sure the file is being run from a specific location.

Let's say the script is located at //candy/gum/scripts/Patch.vbs

I want to parse the ScriptFullName using / as a delimiter and making sure "candy" (the server the script is on) is in it. If it is, it will proceed.

If there's another way of doing this, by all means inform me. Thanks in advance.
 
You may also use the InStr function.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
strLocation = Replace(WScript.ScriptFullName, WScript.ScriptName, "")

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top