Home

About Us

Books

Free Stuff

Oh, So That's How It Works!

Fellow Magicians

Useful Links



WizardWrx Logo

WWSimStatus ReadMe


Package Name

WWSimStatus

Version

1, 0, 0, 2

Synopsis

Exercise conditional code in a script, by simulating a real program returning an error code.

Command Line Syntax

WWSimStatus.exe StatusCode

StatusCode is the status code to be simulated. You can rename the program and include additonal command line arguments to add realism to your test.

The general idea is that you substitute this program for the real program. This allows you to simulate an error condition in a batch file or other script or program without running the real program, which might take a long time to run, make unwelcome changes to files, or have other bad side effects. Likewise, you can rename the binary; the name is not special.

When the batch script under test executes WWSimStatus.EXE, a message box displays, showing you the name you gave to the program file and the status code you want to simulate. When you dismiss the message box, the program returns the status code, and the program under test behaves as if the real program had returned the same status code.

Suggestions for Use

This program works really well in conjunction with WinDummy, another stand-in program that I created to display program command lines, just as the program would see them. Indeed, WWSimStatus.EXE is derived from WinDummy.EXE.

Examples

Example 1

Figure 1 shows the message box displayed when you ask WWSimStatus.EXE to return a status code of 123. The command used to do this is as follows.

WWSimStatus.exe 123
Figure 1 -Program requested to return a status code of 123

Figure 1 - Program requested to return a status code of 123

Example 2

Figure 2 shows what happens when you forget to supply a status code. Since Windows programs always return some status code, we return the default value of zero. Naturally, the command that caused this behavior looks like this.

WWSimStatus.exe
Figure 2 - Program without command line arguments, returning default status code of zero<

Figure 2 - Program without command line arguments, returning default status code of zero

Example 3

Figure 3 shows what happens if you supply too many command line arguments.

Since the program honors the first argument, and displays, but otherwise ignores the rest, you can go ahead and leave the normal command line arguments, which will be displayed.

Note If you do this, you must remember to remove the extra code after the test.

The following command generated the message box shown next.

WWSimStatus.exe 123 456
Figure 3 - Extra command line arguments are ignored, but the desired status code gets set anyway.

Figure 3 - Extra command line arguments are ignored, but the desired status code gets set anyway.

Example 4

A status code must be a valid INTEGER value. If you specify a number that is too big, the screen shown in Figure 4 is the result. The command line that generated this image is as follows.

WWSimStatus.exe 1234567890000
Figure 4 - Oversized numbers turn into a status code of zero.

Figure 4 - Oversized numbers turn into a status code of zero.

Installation

The package contains only the program, a copy of this manual page, and the images shown above. You may install them anywhere. If you have one or more of our other utilities installed on your machine, and you store them in the same directory, the image files that accompany this package will be installed into the existing /images directory. The names of the image files were chosen with this in mind.

Contents of This Package

The table below lists all the files that come in this package.

File Name

Purpose and Other Notes

WWSimStatus.EXE

This is the main program. Feel free to rename this file to add realism to your tests.

WWSimStatus.html

This document, formatted for viewing in any Web browser that supports tables and Cascading Style Sheets.

P6C_POD.CSS

Cascading Style Sheet to accompany WWSimStatus.html.

/images

Folder containing images to accompany WWSimStatus.html.


You may copy and run WWSimStatus.EXE anywhere. It requires no support files, other than MSVCRT.DLL, which is part of all recent (within the last 10 years) Windows installations.

Development History

The table below gives a brief development history of this program.

Date

By Whom

Version

Remarks

04/05/2006

DAG

1, 0, 0, 1

Initial release.

04/08/2006

DAG

1, 0, 0, 2

Amend to show WWSimStatus in the window caption.

Author

David A. Gray, MBA, of Simple Soft Services, Inc., d/b/a WizardWrx.

Copyright

© 2006, Simple Soft Services, Inc., d/b/a WizardWrx. All rights reserved world wide.

Support

This software is freeware. However, in the unlikely event that you need support, you may make your request by email. Please use this form to contact us. Your inquiry will be handled on a best efforts basis, and any information you send us about your specific situation will be treated as confidential. We do, however, reserve the right to incorporate any ideas we get from our correspondence with you into future versions of WWSimStatus or other software either for internal use or for sale. Should we do so, we shall give full credit to its source in the accompanying documentation.

Download your free copy here.

The MD5 digest of this file is dc483cbe47eac956ba58e515489ac5ec. You can use MD5WIN to verify the MD5 digest of this and other files.

WizardWrx Home page www.wizardwrx.com.

WWSimStatus Home Page Other Free Stuff

P6C Contact Info

Copyright and Legal Notice