RRRSystems Posted September 5, 2013 Share Posted September 5, 2013 Hello, I would like to get the name of the .vbs script that is running. I will store that name and some other info as properties once I can get it, I know how to make those changes. In my example I have where I would like to get the name and other info, I am just using a msgbox for now to try and find it. Thanks, Raney '/////////////////////////////////////////////////////////////////////////////// '/ Class.Script.vbs '/////////////////////////////////////////////////////////////////////////////// Option Explicit '/////////////////////////////////////////////////////////////////////////////// '/ 01-0000 2013/09/04; Initial Release; VBScript Version 5.8 Compliant. '/////////////////////////////////////////////////////////////////////////////// Class Script_Object '------------------ Private MyTitle, _ '<<<<< I will add the property here and create the Get and Let MyCopyright, _ ' to go with it MyVersion Private Sub Class_Initialize() MyTitle = "Script_Object" MyCopyright = "2013" MyVersion = "01-0000" End Sub Private Sub Class_Terminate() End Sub Public Property Get Title Title = MyTitle End Property Public Property Get Copyright Copyright = MyCopyright End Property Public Property Get Version Version = MyVersion End Property Property Let Title(StrTitle) MyTitle = StrTitle End Property Property Let Copyright(StrYear) MyCopyright = StrYear End Property Property Let Version(StrVersion) MyVersion = StrVersion End Property End Class '/////////////////////////////////////////////////////////////////////////////// Public Script '/////////////////////////////////////////////////////////////////////////////// Private Sub Initialize() '----------------------- Set Script = New Script_Object msgbox whatever ' <<<< this is where I would like to get the .vbs name and store as a property End Sub '/////////////////////////////////////////////////////////////////////////////// Initialize '/////////////////////////////////////////////////////////////////////////////// Link to comment Share on other sites More sharing options...
justsomeguy Posted September 5, 2013 Share Posted September 5, 2013 It looks like you can use Wscript.ScriptName or Wscript.ScriptFullName. Link to comment Share on other sites More sharing options...
RRRSystems Posted September 5, 2013 Author Share Posted September 5, 2013 I have tried that it gives me the name of the .wsf that includes the .vbs files <job id = "X-Testing.wsf"><script language = "VBScript" Src = ".Include/Class.Script.vbs"/><script language = "VBScript" Src = ".Include/Constants.vbs"/><script language = "VBScript" Src = ".Include/Utility.vbs"/><script language = "VBScript" Src = "Development/X-Testing.vbs"/></job> When I use WScript.ScriptName or WScript.ScriptFullName in the .vbs Script I get the name of this file. Thanks, Raney Link to comment Share on other sites More sharing options...
justsomeguy Posted September 5, 2013 Share Posted September 5, 2013 That's the only thing I found from searching. You can probably find a reference for the WScript object that would list the available properties and methods. Link to comment Share on other sites More sharing options...
RRRSystems Posted September 5, 2013 Author Share Posted September 5, 2013 I thought I had found it with the WScript. I had to do a lot of searching to find that. I will keep on looking and post here when I finally get it. Thanks, Raney Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now