FuNKeR Posted November 9, 2004 Posted November 9, 2004 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?cuFuNKeR
jaclaz Posted November 9, 2004 Posted November 9, 2004 There is more than one way.What you need to add is a line like:Set Path=%PATH%;C:\my_new_pathVia 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.TXTSee more on the COPY command here:http://www.ss64.com/nt/copy.htmlBut, 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 aREM different startup file is specified in an application's PIF.See here:http://www.computerhope.com/issues/ch000549.htmMost probably you need to use the SetX tool explained here:http://windows.about.com/library/tips/bltip419.htmIf you need a more comprehensive tool, have a look at this nifty freeware:http://www.nirsoft.net/utils/nircmd.htmljaclaz
FuNKeR Posted November 9, 2004 Author Posted November 9, 2004 Hi,thanks for your answer. I think, this will help.I need to add the line:set vppath=c:\vpto the autoexec.nt, because otherwise the program won't run (dunno why ). 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)cuFuNKeR
jaclaz Posted November 12, 2004 Posted November 12, 2004 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 lineset vppath=c:\vpto autoexec.nthas 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.TXTCOPY C:\Wherever_is_your_autoexec.nt\autoexec.nt + C:\TEMP.TXT C:\Wherever_is_your_autoexec.nt\autoexec.nt DEL C:\TEMP.TXTHowever 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 2000Open 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. NotesCreating 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 variableFinally 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 OFFset vpath=c:\vpc:\vp\vp.exeyou 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now