
VB Script - Can a running script derive it's own path
Quote:
> VB Script - Can a running script derive it's own path.
> I have a script, that resides on a CD at install time, when it runs, I
> need to get a path to another file on that CD, so I need the script to
> be able to know the path.
> I don't want to try & enumerate all the CD ROM drives on the system,
> because this may not always be run from a CD ROM, the image could be
> copied on a network drive.
> I am sure this is probably easy to do, but darn'ed if I know how.
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
If you're talking about scripts that run under Windows Scripting Host,
you could use 2 properties of the wscript object, scriptName and
scriptFullName.
path = replace(wscript.scriptfullname, wscript.scriptname, "")
See also:
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/script56/html/wsproscriptfullname.asp