MSFN Forum: List of default variables + batch file help. - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

List of default variables + batch file help. Rate Topic: -----

#1 User is offline   gareththegod 

  • Member
  • PipPip
  • Group: Members
  • Posts: 113
  • Joined: 28-September 03

Posted 29 October 2003 - 09:07 AM

I was reading a magazine at lunch time and I came accross a very interesting website (or 2)

Quote

Table 1: Environment Variables

ALLUSERSPROFILE
Local returns the location of the All Users Profile.

APPDATA
Local returns the location where applications store data by default.

CD
Local returns the current directory string.

CMDCMDLINE
Local returns the exact command line used to start the current cmd.exe.

CMDEXTVERSION
System returns the version number of the current Command Processor Extensions.

COMPUTERNAME
System returns the name of the computer.

COMSPEC
System returns the exact path to the command shell executable.

DATE
System returns the current date. This variable uses the same format as the date /t command. Cmd.exe generates this variable. For more information about the date command, see the Date command.

ERRORLEVEL
System returns the error code of the most recently used command. A non-0 value usually indicates an error.

HOMEDRIVE
System returns which local workstation drive letter is connected to the user's home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.

HOMEPATH
System returns the full path of the user's home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.

HOMESHARE
System returns the network path to the user's shared home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.

LOGONSEVER
Local returns the name of the domain controller that validated the current logon session.

NUMBER_OF_PROCESSORS
System specifies the number of processors installed on the computer.

OS
System returns the OS name. Windows XP and Windows 2000 display the OS as Windows_NT.

PATH
System specifies the search path for executable files.

PATHEXT
System returns a list of the file extensions that the OS considers to be executable.

PROCESSOR_ARCHITECTURE
System returns the processor's chip architecture. Values: x86, IA64.

PROCESSOR_IDENTFIER
System returns a description of the processor.

PROCESSOR_LEVEL
System returns the model number of the computer's processor.

PROCESSOR_REVISION
System returns the revision number of the processor.

PROMPT
Local returns the command-prompt settings for the current interpreter. Cmd.exe generates this variable.

RANDOM
System returns a random decimal number between 0 and 32767. Cmd.exe generates this variable.

SYSTEMDRIVE
System returns the drive containing the Windows root directory (i.e., the system root).

SYSTEMROOT
System returns the location of the Windows root directory.

TEMP or TMP
System and User return the default temporary directories for applications that are available to users who are currently logged on. Some applications require TEMP and others require TMP.

TIME
System returns the current time. This variable uses the same format as the time /t command. Cmd.exe generates this variable. For more information about the time command, see the Time command.

USERDOMAIN
Local returns the name of the domain that contains the user's account.

USERNAME
Local returns the name of the user currently logged on.

USERPROFILE
Local returns the location of the profile for the current user.

WINDIR
System returns the location of the OS directory

This came from here.

This website was also in the magazine about batch/command files. I hope this helps.


#2 User is offline   Thanatos 

  • GGTW
  • PipPip
  • Group: Members
  • Posts: 235
  • Joined: 31-August 03

Posted 29 October 2003 - 02:50 PM

Thanks, that makes the FOR command really easy to understand, I think i finally get it. :)

#3 User is offline   [BM]Crusher 

  • Got milk?
  • PipPipPipPip
  • Group: Members
  • Posts: 570
  • Joined: 05-April 04

Posted 20 May 2004 - 01:54 AM

you can just run `SET` at a command prompt to see all the environment settings (it doesn't exactly give you an explanation, but they are self-explanatory)

if you run `FOR /? >FOR.TXT` you get a nice text file (for.txt) with the complete usage for the for command... and it explains it very well i thought

#4 User is offline   RyanVM 

  • Like a big surly teddy bear.
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,661
  • Joined: 31-August 03

Posted 20 May 2004 - 05:18 AM

[BM said:

Crusher,May 20 2004, 03:54 AM] if you run `FOR /? >FOR.TXT` you get a nice text file (for.txt) with the complete usage for the for command... and it explains it very well i thought

geez that's a great idea. I can't believe I haven't thought of that before (seriously, no sarcasm).

#5 User is offline   Tran Thanh Tam 

  • Group: Members
  • Posts: 6
  • Joined: 05-May 04

Posted 22 May 2004 - 05:03 AM

Thanks

#6 User is offline   maxime1978 

  • Group: Members
  • Posts: 2
  • Joined: 18-June 04

Posted 17 November 2004 - 08:33 AM

Oups,

Please remove...

Thanks

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy