Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Inccorect file path

31 views
Skip to first unread message

Andre

unread,
Feb 18, 2018, 2:34:25 AM2/18/18
to
Hi All,

I am trying to call filerun.vbs from tcl. I got the problem for path in vbs message. The script as below;

#1. Tcl file code:
# Tcl path at d:\colo\update\tcl
eval exec -- wscript.exe //nologo "c:/data/filerun.vbs"


'2. vbs file code:
'Vbs file at c:/data
Set fso = CreateObject("Scripting.FileSystemObject")
set path = fso.GetFolder(".")
filePath = path
msgbox filePath

The message result is d:\colo\update\tcl (Why Tcl file path???). The result should be c:/data. What wrong above script?!

Thanks in advance.



Harald Oehlmann

unread,
Feb 18, 2018, 8:46:22 AM2/18/18
to
It might be that the swscript.exe might require a path with backslashes
(native path).
You are in a tricky reagion and might read the wiki about "auto_exec".
Harald

Mike Griffiths

unread,
Feb 18, 2018, 3:41:28 PM2/18/18
to
The current working directory for the program (wscript.exe) is the place it was executed from, not the path of its input file. Because it was executed from a Tcl instance whose pwd was d:/colo/update/tcl/, that's where it runs from. You'll need whatever the VBscript version of Tcl's
[info script]
is to get the directory you want.
0 new messages