SCRIPT Command

Hi,
I am using TCC 11.00.52 Windows XP [Version 5.1.2600], TCC Build 52 Windows XP Build 2600 Service Pack 3.

I have been using CSCRIPT within my .BTM files to execute .xbs scripts for quite some time, and all works well.

I decided today to try the internal SCRIPT command. I verified that SCRIPT is indeed an internal command by doing the following;

Code:
which script
script is an internal command
When I run the SCRIPT command by itself, it produces the following;

Code:
XML
XBScript
VBScript
VBScript.Encode
JScript
JScript.Encode
PerlScript
Seeing that the SCRIPT command recognizes the XBScript, I tried to use it in a .btm as follows;

Code:
script /E xbscript lcba.xbs
Well, that didn't work. Next, I tried

Code:
script lcba.xbs
Ditto, did not work. When I say "did not work", I mean that no output was displayed on the console, and the execution time is rapid, meaning did not work.

If I use;

Code:
cscript lcba.xbs
the script runs without any problems, reads the database, and outputs the desired results to the console.

Am I using the syntax correctly with the SCRIPT command to execute my .xbs files?

Here is a sample, test.xbs

Code:
#include "wsh.ch"

? "Welcome to XBScript"
Running this with CSCRIPT works, but not with SCRIPT.

Joe
 
I cannot comment on your specific issue, because I don't have XBScript in my list of script engines, but a little messing around here suggests that CSCRIPT will search the path for the given filename but SCRIPT does not. Have you tried a fully-qualified filename on your SCRIPT command??

Update: actually, I take that back. Both commands require a fully-qualified filename unless the script file is in the current directory. Ignore me.

FWIW I can get both commands to give similar results with a JScript file, so perhaps there is an issue with the XBScript engine??
 
After further messing around I am rather confused by what SCRIPT is actually doing. If I run a JScript or VBScript via WSH (either directly using Explorer and extension associations or via CSCRIPT) then the engine instantiates a top-level object called WScript. If I do so via the SCRIPT command then that object is called shell. Thus far I cannot find a way to write a script in either language that works in both contexts.
 
Similar threads
Thread starter Title Forum Replies Date
Joe Caverly SCRIPT and GetObject Support 3
vefatica SCRIPT ... TCC disappears Support 2
T How can I send a simple parameter to a script, in tc 25? Support 2
vefatica PSHELL: How pass arguments to script? Support 15
EDerH Powershell call from script Support 24
Joe Caverly .PS1 script does not work with PSHELL Support 11
MickeyF running program from script and (not) returning to script Support 12
T Fixed Echo randomly activated in script Support 4
fpefpe How to? script error Support 1
fpefpe How to? script error Support 0
vefatica @SCRIPT bug persists Support 4
D Catching the result of an evaluated script expression Support 0
Joe Caverly Non-conforming @Script Support 6
M The Matrix: a useless script ... Support 5
fpefpe How to? LUA script Support 0
T Change language in script Support 4
Steve Pitts Documentation Script errors invoking help Support 15
R How to? Launch and execute commands in tcmd.exe through MSBuild Script. Support 3
Joe Caverly @SCRIPT does not like all comments Support 2
Mordachai Help! How to set parameters for script I'm debugging?! Support 6
fpefpe How to? Script support Support 8
JohnQSmith "SCRIPT" Support 7
rconn Script kiddies on the attack Support 4
krischik Stop Script after Syntax Error. Support 6
H Ruby - Running External Ruby script crashes TCC Support 11
T Obfuscating passwords in script Support 14
Stefano Piccardi IDE.exe start toobar button fails when % in script path Support 0
lassevk exit(1) in a python script exits console, by design or bug? Support 1
R break script on syntex error Support 7
K iftp script copy deletes target files Support 17
R script problem with mapped network drive Support 1
Dmitry L. Kobyakov How to? How to remove the record of the old version of the Take Command? Support 5
D Can alias pass parameters to for command? Support 3
samintz How to? Search for %(command) in Help? Support 1
T VIEW only works from command line Support 14
rconn News Take Command / TCC / CMDebug / TCC-RT v28 Released Support 0
T Take Command 28: Lua reports version 5.4.0 (5.4.3 expected) Support 0
Jay Sage WAD Possible Bug With OPTION Command With @FILE Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.24 uploaded Support 0
J Take command does not start on Windows 10 Support 3
vefatica `Back quotes` - command line vs. batch file Support 5
Jay Sage WAD Failure of Alias Command with /Z Option Support 14
Phileosophos Is there any way to open the Take Command options dialog from the command line? Support 8
Phileosophos Command-line Editing Shortkeys That Fail Support 6
fpefpe How to? free (internal) command Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.23 uploaded Support 0
T How to? retain command history across reboot? Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT v27.01 Build 22 Uploaded Support 0
Jay Sage Bug With Flow Control and/or Command Grouping Support 2
GermanDirk How to? EVENTLOG Command with simple User Rights not functional Support 4

Similar threads