×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Help on @os command

Help on @os command

Help on @os command

(OP)
The @os command doesn't seem to be documented anywhere (at least not in the manuals I have).

Anyone have the options etc for this run command?

RE: Help on @os command

Look at the online help in MAPPER: HELP,OS

It will give you an example of what it is and how to use it.  I warn you though MAPPER's online help really stinks with respect to giving good examples.

RE: Help on @os command

(OP)
HELP,OS was the first thing I tried, but the OS command is unknown to the help. Maybe its because I'm running such an old version (windows 8.1.E7)

If you can get a result please paste it here..

Thanks.

RE: Help on @os command

2000/NT   Windows   Þ Þ

Use the Operating System Interface (OS) function and OS statement to execute native commands and programs on the host system.

Operating System Interface Control Line Format

OS [o cmd]

Field    Description
o    Options field (see Operating System Interface Options). Enter options in lowercase characters.
cmd    Command to be performed. The system performs standard path searching to find the command. The system cannot determine whether the operating system syntax specified in this field is valid or if it encountered an error during execution. You need to analyze the generated output to determine whether the execution was successful.
Operating System Interface Statement Format
Windows   Þ Þ

@OS[,c,d,,,lab] o '[cmd]' .

Ü Ü Windows   
2000/NT   Þ Þ

@OS[,c,d,user,psw,lab] o '[cmd]' .

Ü Ü 2000/NT   

Field    Description
c,d    Drawer into which the result is to be returned. For more details, see Specifying Reports or Drawers to Process.
2000/NT   Þ Þ

user    Windows 2000/NT user login.
psw    Windows 2000/NT user password.
Note:  A remote user is required to provide a user-id and password.

Ü Ü 2000/NT   

lab    Label to go to if the command fails.
o    Options field (see Operating System Interface Options). Enter options in lowercase characters. If you do not specify options, you must designate the options field with two apostrophes ('').
cmd    Command to be performed. The system performs standard path searching to find the command.Enclose commands containing embedded spaces in apostrophes ('). If you do not specify a command, designate its position with two apostrophes ('').
Operating System Interface Options

Option    Description
-d    Executes the command using the CMD.EXE shell program. You must use this option to specify any command that is built into the CMD.EXE shell (for example, DIR).
-f    The -f option is always applied to the OS statement and the OS command. It causes the output of the command to be returned as a result. If you enter a file name immediately following the -f option, the Operating System Interface command places a copy of the output from the command into that file.
Operating System Interface Guidelines

Any command executed using the OS command must work correctly as a background program. There is no interactive connection to the command.
If you use both options, make sure a hyphen precedes each option and that a space separates them. Do not combine both options on one hyphen.

Operating System Interface Examples

This example obtains a directory listing and retrieves the output as a result. The equivalent statement also places the directory listing in a result in cabinet 0, drawer B (0,b).

os -d -f dir c:\

Equivalent Statement

@os,0,b '-d -f'  'dir c:\' .

-d    Uses the CMD.EXE shell interface to access the DIR command.
-f    Places the output in a temporary file.
c:\    Executes the DIR command in the root directory of the C drive.
Ü Ü 2000/NT   Windows    

RE: Help on @os command

(OP)
Thank you! :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close