English
Français

Launch Another Windows-based Application From Within TinyTERM

Question :

How do I launch another Windows-based application from within TinyTERM?

Answer :

There is a command in TinyTERM's CScript language that will launch a Windows-based application: spawn(). Here is the function definition (from the CBFR.wri file included with TinyTERM):

Void Spawn
Spawn( iWait, sCmdString, sArguments )
Passes sCmdString to the operating system to be run
with the arguments sArguments. Note that the command name,
without an extension, must always be the first argument
in sArguments. Note that you cannot use quotes as part
of sCmdString or sArguments, so if you must launch an
application with a space in its Windows filename, you
must use DOS 8.3 filenames to refer to that application
with the spawn command.



0

1
2
3

iWait
=====
Wait until spawned process ends before running
next command
No wait
Detach spawned process from the console
Wait for spawned process to complete its startup
procedures before continuing with the next command

For example, the following script command will launch the Notepad application and open the file 'untitled.txt':

spawn( 0, "notepad.exe", "notepad untitled.txt"); Question :

So how would this work with, say, Adobe Acrobat?

Answer :

The command would look like this for Acrobat Reader 5.0:

spawn(1,"C:\\Program Files\\Adobe\\Acrobat 5.0\\Reader\\AcroRd32.exe","AcroRd32 D:\\path\\document.pdf");

Note the use of \\ as a directory separator. You can also use / if you prefer.

TechTip: Starts Minimized - TechTip: Change the Title Bar from the UNIX application - TechTip: Changing Screen Font Size - TechTip: Code Page Setup - TechTip: Configuring TinyTERM to act as a stand-alone file server for your home or office. - TechTip: Correcting License Problems - TechTip: Debug CScript Errors - TechTip: Determining a PC's Physical Location at Login - TechTip: DSL and Cable Modem Compatability - TechTip: Installing Desktop Shortcuts for TinyTERM - TechTip: Launch Another Windows-based Application From Within TinyTERM - TechTip: Map multiple CScript commands to a single key - TechTip: Mapping your Keyboard to Save Time and Money - TechTip: Missing lines, or misaligned characters using SCO ANSI emulation. - TechTip: Port Forwarding. What is it? - TechTip: Port Forwarding with Microsoft Internet Explorer - TechTip: Port Forwarding with Microsoft Outlook - TechTip: Port Forwarding with Microsoft Outlook Express - TechTip: Port Forwarding with the Opera Web Browser - TechTip: Programming the Mouse Button to Copy and Paste Text - TechTip: Resolving A Missing Application Window On TinyTERM Start - TechTip: Resolving an Error - 115 during a NetUtils Installation - TechTip: Resolving License errors from TinyTERM - TechTip: Scripting TinyTERM Events - TechTip: Setting The background color with CScript - TechTip: Stopping the CenLPD service so you can uninstall TinyTERM Plus - TechTip: Term for Linux / Unix Installation. - TechTip: TinyTERM closes after a connection error - TechTip: TinyTERM Support for Code Pages - TechTip: Transparent Printing in v4.2 - TechTip: Troubleshooting Connection Errors - TechTip: Troubleshooting Connection Failure (Error 10065) - TechTip: Troubleshooting Serial Connections - TechTip: Using TinyTERM's Micro Recorder. - TechTip: Wich version of TinyTERM should one use on a particular Microsoft Windows platform? - Terminal Emulation Competitive Analysis - Secure Shell the need for security - TinyTERM detail overview - TinyTERM Suite - TinyTERM Emulation versus TinyTERM Plus -