system/script/parent/path
seems to be the current directory (maybe a bug ;-)
After this there is a rebol-script in %test/, another bat in %test2/ and
a bat in %test3/, which sets the paths to %test2/ and calls the bat there.
the path is set to %wherever/test3/, which is the current directory.
well, it would be more a problem to get the name of the starting bat in 
windows?
except as passing with %0.

secure ask; quick scripts may have quick bugs :-) this will give you 
trace-dialogs

print "the fundamental results:"
probe system/options/script
probe system/script/parent/path

print "making the test: script in test, bat-dir in test2"
error? try [make-dir %test/]
error? try [make-dir %test2/]
error? try [make-dir %test3/]
save %test/where.r [rebol[] probe system/options probe system/script  
    print "script-path, script, start path (resp. of super-script)"
    probe system/script/path
    probe system/options/script
    probe system/script/parent/path
    make error! "hack to hold console. better way?"
]
write %test2/where-view.bat form ["echo %0^/" {"C:\Program 
Files\REBOL\View\rebol"} "..\test\where.r"]
write %test2/where-core.bat form [{"C:\rebol031\rebol"} "..\test\where.r"]
write %test3/where-path.bat form ["path ..\test2;%path%^/" "where-core"]
exit


In einer eMail vom 14.03.00 12:22:09 (MEZ) Mitteleuropäische Zeit schreibt 
[EMAIL PROTECTED]:

<< Thema:    [REBOL] Finding current dir? Re:(2)
 Datum: 14.03.00 12:22:09 (MEZ) Mitteleuropäische Zeit
 From:  [EMAIL PROTECTED]
 Reply-to:  [EMAIL PROTECTED]
 To:    [EMAIL PROTECTED]
 
 
 >If you want to use the directory of the bat file that launched the script
 >then technically it is the parent of the script.
 >
 >You will find that path of that in system/script/parent/path
 
 True, but if trim.bat and trim.r are both in the same
 directory in the path, say N:\UTL, and I run from the
 "current dir" say N:\C\410, don't I still get N:\UTL\ as the
 path to the parent batch file, instead of the "current dir",
 N:\C\410?
 
  >>


Volker

Reply via email to