Computing.Net > Forums > Disk Operating System > Dos 'SET' Command Parameters ??

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Dos 'SET' Command Parameters ??

Reply to Message Icon

Name: Lybush
Date: July 24, 2003 at 09:46:32 Pacific
OS: WIN 98 SE
CPU/Ram: PIII 733/393
Comment:

I noticed in varying places the set /p command. I never knew there were parameters for the 'set' command. Does anyone know what the '/p' does? Also, I read where you may nest a 'FOR In DO' command, but my DOS doesn't let me do that. Why??
Thanks,

Len



Sponsored Link
Ads by Google

Response Number 1
Name: x86
Date: July 24, 2003 at 11:00:57 Pacific
Reply:

http://members.aol.com/axcel216


0

Response Number 2
Name: IVO
Date: July 24, 2003 at 12:55:28 Pacific
Reply:

The commands you posted aren't plain DOS batch statements. They belong to the NT-kernel based Microsoft operating systems, i.e. Windows NT/2K/XP.
While getting the same trading name, Windows 9X/ME and Windows NT/2K/XP are different lines of environments, more different than DOS/Win 3X and their childs Windows 9X (the so called 32 bit systems).
In NT-kernel systems DOS is emulated via NTVDM (NT Virtual Dos Machine) and the related batch language is a more powerfull one, largerly extending the original set of DOS commands.


0

Response Number 3
Name: x86
Date: July 24, 2003 at 13:50:09 Pacific
Reply:

http://www.windowsitlibrary.com/Content/226/03/1.html NT4 DOS


0

Response Number 4
Name: Lybush
Date: July 25, 2003 at 10:21:16 Pacific
Reply:

Thanks, all for your comments. They were all very interesting.

I guess I'll have to live with my current 'set' command. I write COBOL programs and want to do a 'set' from one but it will NOT work. I even generated a batch program from the COBOL problem to do the 'set' but that didn't work either.

Anyone know how this could be done?

Thanks,

Len


0

Response Number 5
Name: IVO
Date: July 25, 2003 at 13:09:32 Pacific
Reply:

Please, explain in detail what you try to generate from your COBOL program, not forgetting to show the exact operating system you are running under (due to the differences previously explained).

May be you get the help you are looking for.


0

Related Posts

See More



Response Number 6
Name: wizard-fred
Date: July 26, 2003 at 04:46:34 Pacific
Reply:

environment variables set in a child(shell) process only exist in the child process. If you exit the exit the parent program you should be able to set the environment.


0

Response Number 7
Name: Len
Date: July 27, 2003 at 13:38:48 Pacific
Reply:

HI,
I running a Dos command from WIN 98 SE.

It is a menu program where the user selects a program to run. However, I need to know what 'dept' the user is in> I ask for it, 3 ch. and want to 'set dept= abc' I need it to last throughout the session and all following sessions after an exit back to Windows. It will last for one session, now but must be reentered if the user went back to Windows and started again.
The program is in MF Cobol, old DOS edition.
I think I am the only one still doing this Cobol.

Thanks,

Len


0

Response Number 8
Name: wizard-fred
Date: July 28, 2003 at 02:35:04 Pacific
Reply:

Maybe you can it to rewrite DOSSTART.BAT
or set it in the Batch file that can be executed in the properties section of the MS-DOS Prompt box.


0

Response Number 9
Name: IVO
Date: July 28, 2003 at 02:41:52 Pacific
Reply:

Hi Len,

Sorry, but I don't understand exactly what you want to do. I try to outline what you posted:

In a DOS box under Windows 98 SE, the user types a command to display a menu from which then he choose an application. In doing so a COBOL program asks him to enter a three chars code to capture dept code.
The department code must be stored into a variable and retained untill the session is exited closing the DOS box.

In other words the initial screen is something like the following:

Dept Code: XXX

1) Application A
2) Application B
................

where Dept (and may be the Menu itself) is displayed by your COBOL program and the response accepted by that.

Please correct or confirm what I wrote; I think your need may be satisfied.


0

Response Number 10
Name: Len
Date: July 28, 2003 at 07:23:11 Pacific
Reply:

Ivo nad others.

Thanks for your help.

Yes, more or less, that is correct. However, like I said,it is very easy to accomplish for one DOS session from Windows. I just ask for the variable and use it. BUt what I need is to retain it in a 'set' variable so that it need not be entered for each subsequent Dos session. The user(s) may exit the menu many times from the DOS session, go back to Win and later that user a different user come back to the Dos menu. That is why 'DOSSTART' will be no good as who knows what user is then using the system.

Hope that explains the problem a bit.

Len


0

Response Number 11
Name: IVO
Date: July 28, 2003 at 09:44:13 Pacific
Reply:

Your program's behavior is not yet exactly clear to me, but if you want to retain the content of a variable across sessions, where "session" stays for opening-running-closing a Windows DOS box, it can't be accomplished setting a variable via the Set command, as in Win 98 SE each DOS box acts like a child process, that limiting the scope of variables.

Instead you should use a "flag" file bearing the user code acting the current session (e.g. Uxxx.flg where xxx stays for Dept Code and the file is stored in root C: - content is no mean, one blank).
On opening the session your COBOL program checks for the presence of flag file and if not found queries for Dept Code generating the file.
On Closing the user has to choose a "Quit" option from your menu that displays a warning message like

"Are you sure to leave ..."

and in response to an affermative entry will ask for the Dept Code for sake of safety.
Then the flag file will be erased; otherwise if the user simply wants to close the window to restart later, then he will choose an "Exit/Suspend" option to close the box without erasing the flag.

That is the way I would design the application, but someone else may give you a better hint.


0

Response Number 12
Name: Len
Date: July 29, 2003 at 08:14:53 Pacific
Reply:

IVO,

I used to use that approach, but had to remove it due to some other issues.

If I knew assembly language programming, I could write a small program to execute from the COBOL program that would permently set the 'set' variable for all sessions. But, I don't anymore. Plus I don't know what area of ram to place the data.

Anyway, thanks for all your help.

L.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Dos 'SET' Command Parameters ??

set command for %date% on NT 4 www.computing.net/answers/dos/set-command-for-date-on-nt-4/10585.html

DOS sort command www.computing.net/answers/dos/dos-sort-command/15177.html

set command in autoexec.bat www.computing.net/answers/dos/set-command-in-autoexecbat/2188.html