** "SYSTEMROOT" or "windir" = path to the Windows folder including the drive letter like "C:\WINDOWS"
** "TEMP" or "TMP" = path to TEMP folder. "C:\TEMP" or the user specific temp folder on later versions.
** "USERNAME" = current Administrator name or "OWNER".
: ''Note:'' There are other possible system settings that are not listed or never used on older versions. Run ''Example 1'' below for a complete list in your system.
<!-- Sentence removed for being unclear/needs revision: * The OS in Win 9X or ME can be found in the "PROMPT" parameter ID. Returns are limited in Win 9X and ME. -->
* ''Note:'' '''QB64''' may not return the same environment list as QBasic or SET did in DOS.
{{PageExamples}}
''Example 1:'' Viewing the list of environmental parameter settings using a counter loop like SET does in DOS.
{{CodeStart}}
{{Cl|DO}}
i = i + 1
setting$ = {{Cl|ENVIRON$}}(i) ' get a setting from the list
{{Cl|PRINT}} setting$
{{Cl|IF...THEN|IF}} i {{Cl|MOD}} 20 = 0 {{Cl|THEN}} {{Cl|PRINT}} "Press a key": {{Cl|SLEEP}}: {{Cl|CLS}}
:''Note:'' Windows environmental settings are listed alphabetically, 20 at a time. '''QB64 may not read all of them or may return an empty string.''' The settings above were returned with SET in DOS. PROMPT returned nothing where SET returned $P$G.
''Example 2:'' Creating a shortcut on a user's desktop for QB64.EXE using the program's icon. Must be run in program's folder to work!
{{CodeStart}}
'=== Enter the EXE file and ICON or BMP image for the shortcut.
Program$ = "QB64.EXE" '<<<<<<<<<< Enter the '''exact''' program name for shortcut
ICON$ = "QB64ICON.BMP" '<<<<<<<<<< Enter icon or bitmap to use from program's folder
DeskTopShortcut Program$, ICON$
{{Cl|END}} '====== END DEMO CODE ======
{{Cl|SUB}} DeskTopShortcut (Program$, ICON$)
f = {{Cl|FREEFILE}}
{{Cl|SHELL}} {{Cl|_HIDE}} "CD > PRGMDIR.INF" 'get the current program path
{{Cl|PRINT (file statement)|PRINT}} #f, "IconIndex = " + Q$ + "0" + Q$ '0 is first index
{{Cl|PRINT (file statement)|PRINT}} #f, "IconFile = " + Q$ + PATH$ + ICON$ + Q$ 'Icon path in working folder
{{Cl|CLOSE}} #f
{{Cl|END SUB}}
{{CodeEnd}}
{{small|Adapted from code by Dav}}
: ''Explanation:'' The SUB program finds the current program's path and user's desktop path. It then creates the shortcut on the desktop with a program icon. The custom icon should be in the program's folder. If an environmental path is not found, the shortcut is placed in the program's folder. The SUB can be added to any program.
:{{Text|'''NOTE:''' A temorary file named PRGMDIR.INF is created and deleted in the example above.}}
''See also:''
* [[ENVIRON]] (statement)
* [[_DEVICES]], [[_DEVICE$]]
* [[_LASTBUTTON]], [[_OS$]]
* [[Windows Environment]]
* [[Windows Libraries#Windows User|Windows User Paths Library]]