Windows
 

Industrial Code and Solutions

for Getting Things Done

_____________________________

Blog List   |   DOS tips & tricks   |  Mac OS X |   Tech Help Home

 

Windows XP Command Line Reference

VBA Dialog Return Values

Windows Environment Variables

________________________________________________________

Device Driver preventing sleep or hibernation (Windows XP) 

This page gives a super simple solution to this problem:

The device driver for your network card is preventing PC from entering standby or hibernation.


Associating a Program with .prn Files (windows)

PRN files are the output type if you choose "Print to a file" on Windows machines.  But then what?  You print them later directly with the print.exe utility program that comes with Windows.  Also, many printers will print files of this type directly.  If a printer has a USB port on it, you can most always print a .prn file from a USB memory stick using this port.

  • Open My Computer
  • Select "Tools | Folder Options | File Types | New"
  • Enter file extension "prn".
  • Find and highlight file type "PRN PRN File" in list. Click "Change".
  • Click on the radio button pbeside "Select the Program from a List". Click "OK".
  • Find and highlight program "Print Utility". Click "OK". Click "Close".

Hint: If you can't find "Print Utility", use the browse button and select c:\Windows\system32\print.exe.


Return Values Associated with Buttons in VBA Dialog Boxes

The following table describes the return values associated with buttons in VBA dialog boxes.

Return value Description
-2 The Close button.
-1 The OK button.
0 (zero) The Cancel button.
> 0 (zero) A command button: 1 is the first button, 2 is the second button, and so on.



Windows Environment Variables

These system environment variables are automatically created by Windows upon boot-up in Windows Registry key HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Control\ Session Manager\ Environment

Variable Sample Typical Value
%SystemDrive% C:
%SystemRoot% C:\WINDOWS
C:\WINNT
%WinDir% C:\WINDOWS
C:\WINNT
%SystemDirectory% C:\WINDOWS\System32
C:\WINNT\System32
%ComSpec% C:\WINDOWS\system32\cmd.exe
The path including the command interpreter program.
%programfiles% C:\WINDOWS\Program Files
%Temp% C:\Users\W\AppData\Local\Temp on Windows Vista & 2008
C:\DOCUME~1\Usr\LOCALS~1\Temp (compressed form of)
C:\Documents and Settings\Usr\Local Settings\Temp
%Tmp%
%HOMEDRIVE% C: The drive letter associated with the user's home directory
%HOMEPATH% The path to the user's home directory as defined in UMD/AD (excluding drive):
\Users\<USERNAME> on Windows Vista & 2008
\Documents and Settings\Guest on Windows XP
%OS% Windows_NT (even on Windows Vista & XP machines
The operating system the user is running
%USERDOMAIN% The name of the domain that contains the user's account. On a stand-alone machine, the same as the machine name.
%USERNAME% The user's name
%USERPROFILE% C:\Users\<USERNAME> — The user's root folder
%USERPROFILE%\Desktop The user's desktop folder

Here are some environment variables that are dynamic:

Variable Sample Typical Value
%SystemDrive% C:
%SystemRoot% C:\WINDOWS
C:\WINNT
%WinDir% C:\WINDOWS
C:\WINNT
%SystemDirectory% C:\WINDOWS\System32
C:\WINNT\System32
%ComSpec% C:\WINDOWS\system32\cmd.exe
The path including the command interpreter program.
%programfiles% C:\WINDOWS\Program Files
%Temp% C:\Users\W\AppData\Local\Temp on Windows Vista & 2008
C:\DOCUME~1\Usr\LOCALS~1\Temp (compressed form of)
C:\Documents and Settings\Usr\Local Settings\Temp
%Tmp%
%HOMEDRIVE% C: The drive letter associated with the user's home directory
%HOMEPATH% The path to the user's home directory as defined in UMD/AD (excluding drive):
\Users\<USERNAME> on Windows Vista & 2008
\Documents and Settings\Guest on Windows XP
%OS% Windows_NT (even on Windows Vista & XP machines
The operating system the user is running
%USERDOMAIN% The name of the domain that contains the user's account. On a stand-alone machine, the same as the machine name.
%USERNAME% The user's name
%USERPROFILE% C:\Users\<USERNAME> — The user's root folder
%USERPROFILE%\Desktop The user's desktop folder