Wikiposts
Search
Computer/Internet Issues & Troubleshooting Anyone with questions about the terribly complex world of computers or the internet should try here. NOT FOR REPORTING ISSUES WITH PPRuNe FORUMS! Please use the subforum "PPRuNe Problems or Queries."

Autoexec.nt & Path

Thread Tools
 
Search this Thread
 
Old 22nd Aug 2006, 18:34
  #1 (permalink)  
Thread Starter
 
Join Date: Nov 2002
Location: 39N 77W
Posts: 1,630
Likes: 0
Received 0 Likes on 0 Posts
Autoexec.nt & Path

I need to add to XP's PATH in order to easily run a set of old DOS programs. I've done this on my old XP machine, but have had no luck on the new one. I put "SET PATH=CWhatIwant" in AUTOEXEC.NT but nothing gets added to the XP PATH variable. This approach works fine on the old XP (both are SP2).

The PIF for the program in question has %SystemRoot%\System32\AUTOEXEC.NT and
ditto\CONFIG.NT just as one would expect.

So, Marge, what am I doing wrong?
seacue is offline  
Old 22nd Aug 2006, 19:03
  #2 (permalink)  
 
Join Date: Nov 2003
Location: In la la land.......
Age: 45
Posts: 174
Likes: 0
Received 0 Likes on 0 Posts
have you tried??

set path=c:\blah\blah;%PATH%
the %PATH% appends this path to the existing one setup by windows and other apps
zoink is offline  
Old 22nd Aug 2006, 19:44
  #3 (permalink)  
Thread Starter
 
Join Date: Nov 2002
Location: 39N 77W
Posts: 1,630
Likes: 0
Received 0 Likes on 0 Posts
I've tried set path=c:\blah\blah;%PATH% with and without the appended PATH part. All within ...\system32\AUTOEXEC.NT Rebooted each time. No joy.

The PATH on my old XP has lots of items starting with the defaults and ending with the item from the AUTOEXEC.NT file.

The new XP's PATH only contains
c:\WINDOWS\System32;c:\WINDOWS;c:\WINDOWS\System32\Wbem
no matter how hard I try to change it. Could XP be copying the default from the repair partition / folder???
seacue is offline  
Old 22nd Aug 2006, 20:13
  #4 (permalink)  

Plastic PPRuNer
 
Join Date: Sep 2000
Location: Cape Town
Posts: 1,898
Received 0 Likes on 0 Posts
Several answers here:

There are actually two PATHs in XP - one for the user and one for the System

1) XP normally ignores AUTOEXEC.BAT completely. If you do a bit of Registry twiddling it will however parse SET commands and set environmental variables.

Registry Settings
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]
Value Name: ParseAutoexec
Data Type: REG_SZ (String Value)
Value Data: (0 = disabled, 1 = enabled)

2) CONFIG.NT and AUTOEXEC.NT control the Windows Virtual DOS Machine (NTVDM) subsystem.

The registry entries that are associated with the NTVDM subsystem are:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment - This key stores the environment variables from the Config.sys and Autoexec.bat files for use in Windows.

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ VirtualDeviceDrivers - This key stores the device drivers that are used in an NTVDM session. Windows Setup creates these entries when a device driver is installed.

3) zoink is quite right - this should add the path to seacue's variables (if you execute it from your login), but make it rather
set path= %PATH%;cblah\blah

Look at the PIF again. You don't HAVE to use CONFIG.NT and AUTOEXEC.NT



4) Start/Settings/Control Panel/System/Advanced/Environmental Variables (down at the bottom)

Add the path to your to User variables for seacue if you want 'em local to you or System variables if you want them to be global
Mac the Knife is offline  
Old 22nd Aug 2006, 20:53
  #5 (permalink)  
Thread Starter
 
Join Date: Nov 2002
Location: 39N 77W
Posts: 1,630
Likes: 0
Received 0 Likes on 0 Posts
Thanks Mr. Knife,

I now have things working by calling the DOS program like
c:\blah\blah\prgm.exe <parameters>
This NOW works even though prgm.exe calls another DOS program in the same folder, etc. It didn't work earlier, but I think I had a typo in AUTOEXEC.NT. It now contains SET PATH=c:\blah\blah without %PATH%

That change in PATH does not persist beyond the program execution as far as I can see. Perhaps the "two PATH" situation had/has me confused.

I didn't use AUTOEXEC.BAT, given to understand that the "NT" extension was what was needed.

I'll follow your suggestions regarding the registry, etc., for a general solution.

Thanks again.

Proon comes through again.
seacue is offline  
Old 22nd Aug 2006, 21:23
  #6 (permalink)  

Plastic PPRuNer
 
Join Date: Sep 2000
Location: Cape Town
Posts: 1,898
Received 0 Likes on 0 Posts
XP deals with DOS programs in interesting ways....

First of all, there are actually two PATHs in XP - one for the user and one for the System

You can change these - Start/Settings/Control Panel/System/Advanced/Environmental Variables (down at the bottom)

Add the directory you need to the path in "User variables for seacue" if you want 'em just for your login or the path in "System variables" if you want them to be global.

But this is inefficient, the change is permanent and it's just more stuff for the sytem to hunt through as it goes about it's business.

BTW XP normally ignores AUTOEXEC.BAT completely. If you do a bit of Registry twiddling it will however parse SET commands and set environmental variables.

Registry Settings
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]
Value Name: ParseAutoexec
Data Type: REG_SZ (String Value)
Value Data: (0 = disabled, 1 = enabled)

So you can create an AUTOEXEC.BAT to set user/system variables, but again, this is inefficient, the change is permanent and it's just more stuff for the sytem to hunt through as it goes about it's business.

Zoink is quite right - this should add the path to seacue's variables (if you execute it from your login), but make it rather
set path= %PATH%;c:\blah\blah
You'd just have to run this from a command window and follow it immediately by invoking your program
C:\blah\blah\myprog.exe
variables set in a command window are not persistent (they evaporate when the command window is closed)

This is clumsy and there are other ways to do it.

Look at the PIF again.
Are you specifying the name of the program correctly on the "Cmd line" - C:\blah\blah\myprog.exe?
Are you specifying the starting directory of the program correctly in "Working" - C:\blah\blah\?

Try adding
set path = %path%;C:\blah\blah to AUTOEXEC.NT

BTW, you don't HAVE to use CONFIG.NT and AUTOEXEC.NT as they stand. You can write a customised CONFIG file and a customised AUTOEXEC file for your app. - just base them on the existing files and store them anywhere, but reference them in the PIF by an absolute path. They're just text files after all that Windows reads line by line - AFAIK it probably doesn't matter what you call 'em so long as they're plain text files.

But you can also forget the PIF and just write a batch file to launch DOS stuff if you don't need to do anything fancy in the way of setting up the DOS environment

@echo off
cls
rem set new path
set path = %PATH%;C:\blah\blah
c:\blah\blah\myprog.exe
rem this leaves C:\blah\blah messily on the path

OR

@echo off
cls
set oldpath = %path%
rem save the old path and set the new one
set path = %path%;c:\blah\blah
c:\blah\blah\myprog.exe
rem tidy up by resetting the old path
set path = %oldpath%

OR (using XP's extended batch systax)

@echo off
cls
rem This is BLAH.BAT (or BLAH.CMD)
rem Set new path
rem this is more elegant!
Setlocal
set path = %path%;C:\blah\blah
c:\blah\blah\myprog.exe
endlocal
rem path goes back to it's original value after Endlocal

Ooooh batch files! That takes me back! I remember writing assembler routines to track down the master copy of the environment and make batch changes to the environment permanent.....

Last edited by Mac the Knife; 22nd Aug 2006 at 21:39.
Mac the Knife is offline  
Old 22nd Aug 2006, 22:24
  #7 (permalink)  
Thread Starter
 
Join Date: Nov 2002
Location: 39N 77W
Posts: 1,630
Likes: 0
Received 0 Likes on 0 Posts
Thank you again Mr. Knife.

I've worn out my computer tolerance for the day but will get to it as soon as possible. Most of tomorrow will be dedicated to other people's problems.

seacue
seacue is offline  

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service

Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.