07-04-2007 06:32 AM
07-04-2007 06:54 AM
07-04-2007 07:17 AM
Hi,
Ingo wrote: ...Is that what you are looking for?
Sorry, but it isn't.
I suppose knowing my path, because when I copy the include-script
in the folder with the file, which includes it like that: ScriptInclude("\Main.vbs"), it will work.
Only the "..\" syntax might be the problem ?
Kind regards,
Jan
07-04-2007 08:35 AM
07-04-2007 09:05 AM
Option Explicit 'Forces the explicit declaration of all the variables in a script.Maybe it helps to answer qour question.
DIM FSO, folder, txt
txt = "path of calling script : " & autoactpath &vbcrlf
Set FSO = CreateObject("Scripting.FileSystemObject")
Set folder = FSO.GetFolder(autoactpath)
txt = txt & "parent path : "&folder.parentfolder&vbcrlf
txt = txt & "drive : "&folder.drive
msgbox txt
scriptstart folder.parentfolder&"\run.vbs"
DIM FSO : Set FSO = CreateObject("Scripting.FileSystemObject")This Line needs only to be called once. It creates an instance of the FilesystemObject, whic is parent to the folder object
scriptstart FSO.GetFolder(autoactpath).parentfolder&"\run.vbs"This line should run with the Scriptinclude command as well. I just tested with scriptstart
07-05-2007 02:37 AM
Hi Jan,
if you don't like fso...:
option explicit
dim intFolderNameLen, strText, intChar
' if you know the length of your foldername
intFolderNameLen = 4 ' hardcoded the length of your "deepest" Foldername add 1 for the "\"
intChar = len(AutoActPath) - intFolderNameLen
strText = cop(AutoActPath, intChar)
msgbox strText
' if the length isn't fix
intChar = InStrRev(AutoActPath,"\",len(AutoActPath)-1,1) ' looking for the 2nd last "\" -> len-1
strText = cop(AutoActPath, intChar)
msgbox strText
07-05-2007 03:25 AM
Hello Ingo, hello Andreas.
Thank you both for helping me. I decided to implement the fso..-solution,
but the other solution looks good as well.
Kind regards,
Jan