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.
|