RRRSystems 0 Posted September 5, 2013 Report 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 '/////////////////////////////////////////////////////////////////////////////// Quote Link to post Share on other sites
justsomeguy 1,135 Posted September 5, 2013 Report Share Posted September 5, 2013 It looks like you can use Wscript.ScriptName or Wscript.ScriptFullName. Quote Link to post Share on other sites
RRRSystems 0 Posted September 5, 2013 Author Report 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 Quote Link to post Share on other sites
justsomeguy 1,135 Posted September 5, 2013 Report 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. Quote Link to post Share on other sites
RRRSystems 0 Posted September 5, 2013 Author Report 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 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.