Kbase 20787: A Problem with Netsetup in a Batch file
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
GOAL:
How to get Netsetup work with a specific script.
GOAL:
Why doesn't the program information file (PIF) work.
FACT(s) (Environment):
Windows 32 Intel
Windows NT 32 Intel/Windows 2000
CAUSE:
- PIF files made with Windows 95 or 98 should not be exchanged with ones that are made with Windows NT or 2000. This does not necessarily error out in any particular manner but these PIFs fail to launch netsetup, and might act erratically.
- Netsetup works properly on the command line, but not in a specific script. The program information file (PIF) used to launch the batch file can be the cause of the problem.
FIX:
Excerpts from the Microsoft Knowledge Base explain the differences in PIF files:
Windows NT provides a fully-integrated command prompt
that enables you to launch both Windows-based and MS-
DOS-based applications. Although the concept of
running an MS-DOS-based application in a Windows-based
environment may be familiar to you, Windows NT handles
this somewhat differently than Windows (16-bit) does.
The essential difference lies in the command prompt
itself; under Windows NT, the command prompt is a 32-
bit Windows NT-based application, not the virtual MS-
DOS machine you would expect from Windows. Under
Windows NT, until you start an MS-DOS-based
application, no virtual MS-DOS machine is created.
Furthermore, once you start an MS-DOS-based
application, its virtual MS-DOS machine is used for
all subsequent MS-DOS-based applications started from
the same command prompt.
As in Windows, each MS-DOS-based application can have
a program information file (PIF). If there is no PIF
for a particular application, the default PIF,
_DEFAULT.PIF, is used. Because Windows NT only uses
the PIF from the first application started in any
given command prompt, you may need to take special
care in the way you start your applications.
For example, if you design a PIF that allocates
some EMS memory, it is important that you start the
associated application first; otherwise, the EMS
memory may never be allocated.
You may start a Windows NT command prompt and then run
the MS-DOS command, MEM, to see how much memory you
have free. Because MEM is another MS-DOS-based
application, Windows NT creates a virtual
MS-DOS machine, probably using _DEFAULT.PIF. After MEM
finishes, you start the application you created the
PIF for.
Unfortunately, because _DEFAULT.PIF doesn't instruct
Windows NT to allocate EMS memory, your application
reports that it can find no EMS memory. Rechecking the
PIF you created does not solve the problem. You need
to start another command prompt and then make sure to
start your EMS-requiring application first, before you
start any other MS-DOS-based applications.
There is one more difference to be aware of: each PIF
contains a pointer to AUTOEXEC and CONFIG files.
Usually, these default to the Windows NT versions,
AUTOEXEC.NT and CONFIG.NT. If you want to change
environment variables for your MS-DOS-based
applications, you need to point their PIFs to
different files or modify the default ones. (To
see these files and their locations, run PIF Editor
and choose Windows NT.)