PDA

View Full Version : W2000 temp/tmp statements


ndebord
September 16th, 2006, 01:45 PM
It seems that my DOS/16 bit apps cause me a bit of a problem with my set statements in W2000. One solution I have read about is to change temp and tmp to C:\temp. Where in W2000 do you do that and exactly how? (Also it seems that NTVDM.EXE is taking up a lot of resources, probably because of my legacy programs and a short path statement for temp files is one solution I've read about.

(Below I garnered from a MSDOS box and typing "Set")

SYSTEMROOT=C:\WINNT
TEMP=C:\DOCUME~1\EVERYM~1.EVE\LOCALS~1\Temp
TMP=C:\DOCUME~1\EVERYM~1.EVE\LOCALS~1\Temp


Any help much appreciated.

Lindsey
September 16th, 2006, 11:08 PM
Where in W2000 do you do that and exactly how?
Try MyComputer | Properties | Advanced | Environment variables, and add them to the System Variables.

--Lindsey

ndebord
September 17th, 2006, 12:53 AM
Try MyComputer | Properties | Advanced | Environment variables, and add them to the System Variables.

--Lindsey


Lindsey,

I'm not sure how you do that. I see User variables for Everyman as follows:

TEMP C:\Documents and Settings\Everyman.EVERYW20...

When I click on EDIT, I see a Variable name of TEMP

and a Variable Value of: %USERPROFILE%\Local Settings\Temp

I assume the userprofile in %% refers to c:\documents and Settings (etc.).

How do I change that to C:\temp (for TMP and TEMP).


This is completely different from SET statements and path statements in W98se.

<sigh>

Lindsey
September 17th, 2006, 06:26 PM
This is completely different from SET statements and path statements in W98se.
Yeah, they're set up differently from the SET statements, but they operate the same way.

Just type the path you want to use into the values for the TEMP and TMP variables. You don't have to use the generic profile designations if you don't want to. (There will probably be TEMP and TMP settings in the System variables, too -- the lower window. I suspect those are the ones you really want to change for the 16-bit applications, but that's just a guess on my part.)

--Lindsey

Mike Landi
September 17th, 2006, 06:28 PM
N, Lindsey gave you good advice. The environment variables are "set" before the NTVDM session launches. I encourage you to explore the "Advanced" tab under the Properties for the "My Computer" icon. Also, check out the Manage option that appears when you right-mouse click on My Computer.

Win2k establishes the "properties" for programs before they are launched...in the style of a "real" operating system.

Also, do not worry about resources being used by a particular program. Win2k (NT and XP also) allow programs to "think" they are using resources, but the OS takes care of keeping everything under control.

As silly as this sounds at first, you can "trust" Win2k to manage your computer much more than Win95/98/me. The two "branches" of the Windows family of OS's are VERY different.

ndebord
September 18th, 2006, 01:12 AM
N, Lindsey gave you good advice. The environment variables are "set" before the NTVDM session launches. I encourage you to explore the "Advanced" tab under the Properties for the "My Computer" icon. Also, check out the Manage option that appears when you right-mouse click on My Computer.

Win2k establishes the "properties" for programs before they are launched...in the style of a "real" operating system.

Also, do not worry about resources being used by a particular program. Win2k (NT and XP also) allow programs to "think" they are using resources, but the OS takes care of keeping everything under control.

As silly as this sounds at first, you can "trust" Win2k to manage your computer much more than Win95/98/me. The two "branches" of the Windows family of OS's are VERY different.


Mike & Lindsey,

Just to be sure before I do this. All that %% stuff had me going.

So I can safely ignore having to type in all that, and simply type in C:\TEMP instead, yes?

Mike Landi
September 18th, 2006, 09:20 AM
You can, but should not. The reason why is that %temp% is a pointer in Windows 2000, where Windows takes care of resolving the location of where the %temp% location is.

The reason you want to use %temp% is the BAT or CMD files you create using Windows 2000 can be moved to another computer without you having to check all of the "C:\" references.

ndebord
September 18th, 2006, 02:05 PM
You can, but should not. The reason why is that %temp% is a pointer in Windows 2000, where Windows takes care of resolving the location of where the %temp% location is.

The reason you want to use %temp% is the BAT or CMD files you create using Windows 2000 can be moved to another computer without you having to check all of the "C:\" references.


Mike,

Please treat me like the rank newbie I am in W2000. I see user and system variables. In user I'm about to do to the following, change:

%USERPROFILE%\Local Settings\Temp

TO

%USERPROFILE%\Temp

which should make the temp folder for my system change from something in documents to c:\temp.

I'll make the same change for the TMP statement.

Now in system variables, i se the following:

TEMP C:\WINNT\TEMP
TMP C:\WINNT\TEMP

I "think" I want to change that also.


%SystemRoot%\TEMP


Above is what I see when I want to edit the info. It is picking up c:\WINNT as the system root and I want to make the C:\ root as the root, if I am making myself clear here.

Gary Maltzen
September 18th, 2006, 09:45 PM
Assuming that
%USERPROFILE%
* translates to something like *
"C:\Documents and Settings\Nick Debord"

%USERPROFILE%\Local Settings\Temp
* translates to *
"C:\Documents and Settings\Nick Debord\Local Settings\Temp"


%USERPROFILE%\Temp
* translates to *
"C:\Documents and Settings\Nick Debord\Temp"
(which probably does not exist)

Gary Maltzen
September 18th, 2006, 09:48 PM
%SystemRoot%
* typically translates to one of the following *
"C:\Windows"
"C:\Winnt"

%SystemRoot%\Temp
* might translate, for example, to *
"C:\Windows\Temp"

Gary Maltzen
September 18th, 2006, 09:50 PM
The easiest way to see what the current SET values are is to open a command (CMD or COMMAND) prompt and use the command "SET". Without any parameters SET will show you what the current settings are.

Mike Landi
September 19th, 2006, 09:49 AM
N, open up a command prompt (Start, Run, enter "CMD") and at the prompt, type SET. That will show you the settings of all of these % variables that are giving you headaches.

I wonder why you are trying to get TEMP/TMP to be C:\WINNT\TEMP? The problem with that is Win2k, and WinXP especially, tries to protect the system folder (\WINNT) and having the temp folder under it is frowned upon. That is why the default location for temp files is under "Documents and Settings". In that way, the temp files your programs use are kept under your user account and separate from the OS itself.

You may want to not "fight" Windows on this one. (I did for the first few months I had Windows NT, and finally realized that Windows was happier if I did not force it to do things "my way".)

ndebord
September 20th, 2006, 12:03 AM
N, open up a command prompt (Start, Run, enter "CMD") and at the prompt, type SET. That will show you the settings of all of these % variables that are giving you headaches.

I wonder why you are trying to get TEMP/TMP to be C:\WINNT\TEMP? The problem with that is Win2k, and WinXP especially, tries to protect the system folder (\WINNT) and having the temp folder under it is frowned upon. That is why the default location for temp files is under "Documents and Settings". In that way, the temp files your programs use are kept under your user account and separate from the OS itself.

You may want to not "fight" Windows on this one. (I did for the first few months I had Windows NT, and finally realized that Windows was happier if I did not force it to do things "my way".)

Mike,

I use a lot of 16 bit and DOS apps and was getting a lot of churn and large CPU usage. I read that NTVDM (I'm paraphrasing here, as I don't have the relevant text in front of me and I'm rank newbie here anyway) had trouble with LFN and spaces and so wanted to look towards a solution, which in the past was to use C:\TEMP and C:\TMP folders in earlier OSes.

Mike Landi
September 20th, 2006, 12:17 PM
NTVDM absolutly does not have problems with LFNs. In fact, Windows 2000 will translate LFNs to regular 8.3 names automatically.

You should not use the workarounds and tricks you learned for the DOS-based versions of Windows. Windows NT/2k/XP, etc. are different beasts. I learned this myself when I used to try to "fight" Windows NT and try to get it to do things "my way". Most of time, I wound up doing things the Windows way and adapting to them. <sigh>

Gary Maltzen
September 20th, 2006, 04:51 PM
...trouble with LFN and spaces...As Mike says, NTVDM is not the culprit; usually it is the application that will interpret a space as the end of a filename or directory name or may restrict names to 8.3 format. The solution is to use the "mangled" pathname, for example C:\DOCUME~1\NICKDE~1\TEMP

Name mangling usually takes the first six non-blank characters of the first component and adds a unique squiggle-sequence (~1, ~2, etc.) plus the first three non-blank characters of the second component; "components" are separated by dots.

For example, I just opened a Win2K CMD window and executed the following test (which took me back where I started)
C:\Documents and Settings\Gary Maltzen>cd \
C:\>cd docume~1
C:\DOCUME~1>cd garyma~1
C:\DOCUME~1\GARYMA~1>

ndebord
September 21st, 2006, 02:28 AM
As Mike says, NTVDM is not the culprit; usually it is the application that will interpret a space as the end of a filename or directory name or may restrict names to 8.3 format. The solution is to use the "mangled" pathname, for example C:\DOCUME~1\NICKDE~1\TEMP

Name mangling usually takes the first six non-blank characters of the first component and adds a unique squiggle-sequence (~1, ~2, etc.) plus the first three non-blank characters of the second component; "components" are separated by dots.

For example, I just opened a Win2K CMD window and executed the following test (which took me back where I started)
C:\Documents and Settings\Gary Maltzen>cd \
C:\>cd docume~1
C:\DOCUME~1>cd garyma~1
C:\DOCUME~1\GARYMA~1>

Gary & Mike,

I understand the 8.3 thing and that it is the app that causes problems. I made some changes in SYSTEM settings, but not USER. This is my set statement now.

I'm of a mind to change the user statement to C:\TEMP for TEMP And TMP and wonder what could be wrong with doing it that way.

COMPUTERNAME=EVERYW2000
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\Everyman.EVERYW2000
LOGONSERVER=\\EVERYW2000
MOZ_PLUGIN_PATH=C:\K-Meleon\PLUGINS
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
OS2LIBPATH=C:\WINNT\system32\os2\dll;
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\ Wbem;C:\BAT;C:\BIN;C:\QEDIT
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WS F;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0803
PROGRAMFILES=C:\PROGRA~1
PROMPT=$P$G
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINNT
TEMP=C:\DOCUME~1\EVERYM~1.EVE\LOCALS~1\Temp
TMP=C:\DOCUME~1\EVERYM~1.EVE\LOCALS~1\Temp
TZ=EST5EDT
USERDOMAIN=EVERYW2000
USERNAME=Everyman
USERPROFILE=C:\DOCUME~1\EVERYM~1.EVE

Gary Maltzen
September 21st, 2006, 12:31 PM
I'm of a mind to change the user statement to C:\TEMP for TEMP And TMP and wonder what could be wrong with doing it that way.In your case, it probably is acceptable.

WinNT and offspring are multi-user systems (i.e., multiple accounts can be simultaneously logged on). Older apps tend to use a canned temporary file name - which could cause a problem if multiple users started the app under different credentials but using the same temporary directory.

ndebord
September 21st, 2006, 10:22 PM
In your case, it probably is acceptable.

WinNT and offspring are multi-user systems (i.e., multiple accounts can be simultaneously logged on). Older apps tend to use a canned temporary file name - which could cause a problem if multiple users started the app under different credentials but using the same temporary directory.

Gary,

There are exactly ONE multiple users on this system: ME! <g> If I understand this properly, each USER would have their own location, as of now, something under c:\documents......

IF I were to change my settings to C:\TEMP for TMP and TEMP, then IF perchance there were to be new local users, they would be automatically assigned to C:\documents..... UNLESS I also changed their settings in control panel. IF, however, my changing to C:\TEMP would change the default for all potential users, I would definitely not follow through with this.

Mike Landi
September 22nd, 2006, 10:09 AM
There are exactly ONE multiple users on this system: ME!

N, you need to change how you think about your computer. There may be only one physical, human user, you. However, there is at least one other user, the system itself.

Right-mouse click on "My Computer" and choose Manage. Find the "Local Users and Groups" branch and look around. I'll bet you find yourself, "Guest", and probably "ASP.NET", plus possibly others.

The "NT" family of Windows sets up the computers core OS and then builds users from that. Many system services that you used to think of as part of the OS are now (I'm generalizing here) independent processes. The backup program I use creates its own user profile that can log on and run backup jobs, as an example.

The "private" model of you and the operating system alone using the hardware is not how Windows works these days. It is more of the "VM" model from the old IBM 360/370 days.

ndebord
September 24th, 2006, 11:57 AM
N, you need to change how you think about your computer. There may be only one physical, human user, you. However, there is at least one other user, the system itself.

Right-mouse click on "My Computer" and choose Manage. Find the "Local Users and Groups" branch and look around. I'll bet you find yourself, "Guest", and probably "ASP.NET", plus possibly others.

The "NT" family of Windows sets up the computers core OS and then builds users from that. Many system services that you used to think of as part of the OS are now (I'm generalizing here) independent processes. The backup program I use creates its own user profile that can log on and run backup jobs, as an example.

The "private" model of you and the operating system alone using the hardware is not how Windows works these days. It is more of the "VM" model from the old IBM 360/370 days.

Mike,

Yes, 3 listings: Administrator, Everyman and Guest. Don't know see ASP.NET.

I just don't like seeing all my settings for temp/tmp sitting deep under C:\Documents.....

Gary Maltzen
September 24th, 2006, 12:27 PM
I just don't like seeing all my settings for temp/tmp sitting deep under C:\Documents.....There's nothing stopping you from creating/using C:\TEMP\NICK (or C:\NICK.TMP ?) as your temp setting.

Mike Landi
September 24th, 2006, 10:05 PM
I just don't like seeing all my settings for temp/tmp sitting deep under C:\Documents.....

I did not like it either. I was more comfortable with it when I found out that I could open Windows Explorer and put "%temp%" in the address bar (even set a shortcut to it) and have Windows jump to the right place.

ndebord
September 25th, 2006, 07:38 PM
There's nothing stopping you from creating/using C:\TEMP\NICK (or C:\NICK.TMP ?) as your temp setting.

Gary,

How would you do that in the language of NT? Justtype in C:\TEMP? Considering that USER settings (User variables for Everyman) now say:


%USERPROFILE%\Local Settings\Temp

So would that translate into:

\TEMP

(I'm looking at exactly what I must type into System Properties/Advanced/Edit User Variable.

I think I'm scared enough not to try and change such settings in system variables without understanding this stuff one hel* of a lot more than I do so far.

Gary Maltzen
September 26th, 2006, 01:00 PM
How would you do that in the language of NT?If you open a command prompt window and use the "SET" command without any parameters you will get a list of current SET values; note that %SYSTEMDRIVE% is set to "C:".

To define %TEMP% as the "\NICK.TMP" directory on the System Drive you would use the value TEMP=%SYSTEMDRIVE%\NICK.TMP

(Of course you will want to create the directory before doing this...)

ndebord
September 27th, 2006, 11:43 PM
If you open a command prompt window and use the "SET" command without any parameters you will get a list of current SET values; note that %SYSTEMDRIVE% is set to "C:".

To define %TEMP% as the "\NICK.TMP" directory on the System Drive you would use the value TEMP=%SYSTEMDRIVE%\NICK.TMP

(Of course you will want to create the directory before doing this...)

Gary,

How's this?

TEMP=%SYSTEMDRIVE%\TEMP
TMP=%SYSTEMDRIVE%\TEMP

Gary Maltzen
September 28th, 2006, 03:09 PM
That should work fine -- assuming that only ONE user has that setting. I would have preferred something that was more user-specific lest two simultaneous copies of an app overwrite each other's temp files...