Jump to content

Recommended Posts

Posted

Hi,

is it possible to add a line to the Windows 2000 file "autoexec.nt" via batch file? I want to create a package with a bunch of programs and of them needs to have another entry in this file.

The second problem with this program is, that it also needs an entry in the PATH-variable.

Does anyone know, how to add these informations?

cu

FuNKeR


Posted

There is more than one way.

What you need to add is a line like:

Set Path=%PATH%;C:\my_new_path

Via batch you could do something like:

ECHO Set Path=%PATH%;C:\my_new_path >

COPY C:\Wherever_is_your_autoexec.nt\autoexec.nt + C:\TEMP.TXT C:\Wherever_is_your_autoexec.nt\autoexec.nt

DEL C:\TEMP.TXT

See more on the COPY command here:

http://www.ss64.com/nt/copy.html

But, you sure you need to write a line to it?

REM AUTOEXEC.BAT is not used to initialize the MS-DOS environment.

REM AUTOEXEC.NT is used to initialize the MS-DOS environment unless a

REM different startup file is specified in an application's PIF.

See here:

http://www.computerhope.com/issues/ch000549.htm

Most probably you need to use the SetX tool explained here:

http://windows.about.com/library/tips/bltip419.htm

If you need a more comprehensive tool, have a look at this nifty freeware:

http://www.nirsoft.net/utils/nircmd.html

jaclaz

Posted

Hi,

thanks for your answer. I think, this will help.

I need to add the line:

set vppath=c:\vp

to the autoexec.nt, because otherwise the program won't run (dunno why :blink:). It is a very old program...

But I think you did not get my problem right (maybe I did not explain it enough ;)):

I need to add a line to the following... I don't know... stuff *g*, where I can write the variables to.

(see attachment)

cu

FuNKeR

Posted

I think I have understood the problem, but maybe I did not make myself clear.

Let see if I can better explain myself:

Adding the line

set vppath=c:\vp
to autoexec.nt

has the effect to modify the ENVIRONMENT VARIABLE "VPPATH"

in all dos boxes.

so that the first part of my previous post should read:

ECHO Set vpath=c:\vp > C:\TEMP.TXT

COPY C:\Wherever_is_your_autoexec.nt\autoexec.nt + C:\TEMP.TXT C:\Wherever_is_your_autoexec.nt\autoexec.nt

DEL C:\TEMP.TXT

However NT based systems have the possibility to:

1) use a particular file INSTEAD of autoexec.nt by specifying it in the .pif file for that particular app (so that in your case you could make a copy of autoexec.nt called, say autoexec.vp, add to it he needed line set vppath=c:\vp and create a .pif file for that particular app pointing to this autoexec.vp file, of course you start the app by doubleclicking on the .pif file INSTEAD that on the executable.

To create or change a program information file (PIF) in Windows 2000

Open My Computer.

Do one of the following:

If you want to create a PIF file for a program, locate the program and right-click

it. Then click Properties and change the default settings to match the program requirements.

If you want to change the settings of an existing PIF file, locate the shortcut to

the program file and right-click it. Click Properties and make the appropriate changes.

Notes

Creating a program information file (PIF) for an MS-DOS-based program creates a shortcut

to the program executable. All the settings saved in the PIF file are contained in

the shortcut.

Prior to creating or making changes to the PIF, please review the MS-DOS-based program

documentation. Changing the PIF affects how the program interacts with Windows 2000

Professional. The program may only work correctly with specific default settings.

To specify whether an MS-DOS-based program starts in a full screen or in a window,

change the Run properties on the Program (or Shortcut) tab.

To view MS-DOS-based program output on the screen faster, after clicking Properties

in step 2, on the Screen tab, select Fast ROM emulation under Performance. Please

review the documentation that came with your video card to ensure it supports Fast

ROM emulation.

To increase the performance of the MS-DOS-based program, you can allocate more memory.

To make this change, after clicking Properties in step 2, on the Memory tab, set

Expanded (EMS) memory or Extended (XMS) memory to Auto, and no limit will be imposed.

If you experience program errors, set the value in the Total window to 8192.

The Properties dialog box has replaced the PIF Editor used in earlier versions of

Windows.

2) by means of the linked program setX make vppath a GLOBAL environment variable

Finally there is a third possiblity, which is to create a batch file .bat to CALL that particular app (I assume the executable is called vp.exe), i.e.:

@ECHO OFF

set vpath=c:\vp

c:\vp\vp.exe

you double click on the .bat file above INSTEAD that on vp.exe, it will set the vpath variable for THAT dos session and execute the program AFTER the vpath is correctly set.

Hope the above clears the matter.

jaclaz

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...