Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Sys_Execute() of a batch file with a TIMEOUT does not run in invisible mode

Sys_Execute() of a batch file with a TIMEOUT does not run in invisible mode

When attempting to execute a batch file which includes a TIMEOUT in invisible mode using the Sys_Execute() function, then the batch file will not run and Silk Test proceeds to the next step in the script. 

This is known limitation with using a TIMEOUT in a batch file and is not an issue caused by Silk Test.

When TIMEOUT is executed in a background batch script, it will result in "ERROR: Input redirection is not supported, exiting the process immediately.". The TIMEOUT command will run OK in a console or terminal session.

When TIMEOUT is executed, it tries to redirect the input. The command is waiting for the user to interrupt the wait period. This is not possible if the command is executed in the background(invisible mode). It does not have any possibility of retrieving input and fails immediately. This is as designed for the TIMEOUT command in Windows.

You can verify this by returning the output from the command line using Sys_Execute()

[ ] LIST OF STRING lsOutPut
     [ ]
     [ ] Sys_Execute("C:\cmd.bat", lsOutPut)
     [ ]
     [ ] print(lsOutPut)


This should return the error "ERROR: Input redirection is not supported, exiting the process immediately" in the Silk Test results. 

To workaround this will have to use "start" in your command line. Alternatively, if you are looking to use  TIMEOUT in a batch script to add a delay to your script, you can simply use a Sleep() call in your 4Test code instead to add a delay.

[ ] LIST OF STRING lsOutPut
     [ ] 
     [ ] Sys_Execute("start C:\cmd.bat", lsOutPut)
     [ ] 
     [ ] print(lsOutPut)

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2016-10-27 11:12
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.