Hello,
I am trying to return the File Information from a subroutine in a VBScript file Whatever that Script is Named or Located
The Script is included in a .wsf Script:
<job id = "X-Testing.wsf">
<script language = "VBScript" Src = ".Include/Class.Script.vbs"/>
</job>
I am trying to get the File Info from Class.Script.vbs
Sub ShowFileInfo()
Dim FSO, F, PathName
Set fso = CreateObject("Scripting.FileSystemObject")
'Set F = FSO.GetFile() 'Wrong Number of Arguments
'Set F = FSO.GetFile("") 'Invalid Procedure Call or Argument
'Set F = FSO.GetFile(".") 'File Not Found
'Argument in examples is always filespec, but nobody explains filespec
Set F = FSO.GetFile("C:\RRRSystems\Software\Script\.Include\Class.Script.vbs")
'This works but I want it for the current file whatever that may be
'even if I rename, move it or use the class in another Script
MsgBox F.Name
'MsgBox F.Path
'MsgBox F.ShortName
'MsgBox F.ShortPath
'MsgBox F.DateCreated
'MsgBox F.DateLastAccessed
'MsgBox F.DateLastModified
'PathName = FSO.GetAbsolutePathName(".")
'MsgBox PathName 'This returns tha PathName of the .wsf Script
'MsgBox WScript.ScriptName ' This returns the name of the .wsf Script
' probably because its an include
End Sub
Any Ideas?
Thanks Raney
I am trying to return the File Information from a subroutine in a VBScript file Whatever that Script is Named or Located
The Script is included in a .wsf Script:
<job id = "X-Testing.wsf">
<script language = "VBScript" Src = ".Include/Class.Script.vbs"/>
</job>
I am trying to get the File Info from Class.Script.vbs
Sub ShowFileInfo()
Dim FSO, F, PathName
Set fso = CreateObject("Scripting.FileSystemObject")
'Set F = FSO.GetFile() 'Wrong Number of Arguments
'Set F = FSO.GetFile("") 'Invalid Procedure Call or Argument
'Set F = FSO.GetFile(".") 'File Not Found
'Argument in examples is always filespec, but nobody explains filespec
Set F = FSO.GetFile("C:\RRRSystems\Software\Script\.Include\Class.Script.vbs")
'This works but I want it for the current file whatever that may be
'even if I rename, move it or use the class in another Script
MsgBox F.Name
'MsgBox F.Path
'MsgBox F.ShortName
'MsgBox F.ShortPath
'MsgBox F.DateCreated
'MsgBox F.DateLastAccessed
'MsgBox F.DateLastModified
'PathName = FSO.GetAbsolutePathName(".")
'MsgBox PathName 'This returns tha PathName of the .wsf Script
'MsgBox WScript.ScriptName ' This returns the name of the .wsf Script
' probably because its an include
End Sub
Any Ideas?
Thanks Raney