8.157 SH (Shell command)

8.157.1 Function

The SH command passes the given command and the parameters (if any) as-is to the shell for process-
sing. The results of the passed command are displayed on the Hercules console.

The special ‘STARTGUI’ command must be used if the command being started either directly or indirectly
starts a Windows graphical user interface (non command-line) program (e.g. Notepad). If STARTGUI is
not used in such cases then Hercules will hang until the graphical user interface program is closed. Note
that starting a batch file (command line program) that itself starts a graphical user interface program still
requires using STARTGUI.

If “foo.bat” contains “start notepad.exe” then issuing “sh foo.bat” will hang Hercules until Notepad is being
closed. The same applies if “sh start foo.bat” is used. The correct way is using ‘STARTGUI’ for invoking
foo.bat is “sh startgui foo.bat”.

8.157.2 Syntax

Descriptive

command [arg [arg ... ]]

Diagram

¬¬¬¬¬¬¬¬§¬¬¬ command ¬¬¬§¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬§¬¬¬¬¬¬ÊÍ












arg

8.157.3 Parameter

STARTGUI

STARTGUI must be used if the command passed to the shell either directly or in-
directly starts a Windows graphical user interface (non command-line) program.

command

The command that is to be passed to the shell.

arg

These are the parameters passed to the command.

8.157.4 Examples

Example 1:

Display the current working directory through the shell command 'DIR'.

HHC00013I Herc command: 'sh dir'

Volume in drive D is Hercules

Volume Serial Number is E21F-FE83

Directory of D:\hercules

13.10.2010 21:23 <DIR> .

13.10.2010 21:23 <DIR> ..

16.12.2007 01:00 282'624 AWSBrowse32.exe

16.12.2007 01:00 503'808 AWSBrowse32D.exe

16.12.2007 01:00 274'432 AWSBrowse32U.exe

16.12.2007 01:00 491'520 AWSBrowse32UD.exe

28.02.2007 06:24 323'072 AWSBrowse64.exe

28.02.2007 06:24 647'168 AWSBrowse64D.exe

28.02.2007 06:24 317'440 AWSBrowse64U.exe

28.02.2007 06:24 636'416 AWSBrowse64UD.exe

16.12.2007 01:00 934 awshet.reg

12.10.2010 18:24 14'336 cckdcdsk.exe

12.10.2010 18:24 13'824 cckdcomp.exe

12.10.2010 18:24 73'728 cckddiag.exe

12.10.2010 18:24 15'360 cckdswap.exe

.

several lines not displayed

.

16.12.2007 01:00 131'072 TunTap32.dll

16.12.2007 01:00 344'064 TunTap32D.dll

16.12.2007 01:00 135'168 TunTap32U.dll

16.12.2007 01:00 344'064 TunTap32UD.dll

28.02.2007 06:27 144'384 TunTap64.dll

28.02.2007 06:27 561'664 TunTap64D.dll

28.02.2007 06:27 147'456 TunTap64U.dll

28.02.2007 06:27 565'760 TunTap64UD.dll

13.06.2010 22:04 <DIR> util

12.10.2010 18:24 19'968 vmfplc2.exe

13.10.2010 21:23 8'157 x.log

20.07.2005 11:48 59'904 zlib1.dll

127 File(s) 24'988'911 bytes

5 Dir(s) 67'712'364'544 bytes free

Figure 287: SH command

Previous Page Next Page