PCbanter

PCbanter (http://www.pcbanter.net/index.php)
-   Windows 10 Help Forum (http://www.pcbanter.net/forumdisplay.php?f=52)
-   -   Is there a system environment variable to the System32 directory? (http://www.pcbanter.net/showthread.php?t=1111176)

Arlen Holder September 16th 20 05:01 PM

Is there a system environment variable to the System32 directory?
 
Is there a system environment variable to the System32 directory?
o cd %system32%

I haven't seen one but there should be, IMHO, so, maybe it exists?
o Here's, at this very moment, where I'd like to use it, for example.


Setting up a PC that BOSD'd, I just created this custom command:

1. Rightclick create a shortcut C:\app\os\commands\links\curlit.lnk
Whose TARGET is %comspec% /k %Windir%\System32\curl.exe icanhazip.com

2. Add an AppPaths key named "curlit.exe" so you can run that command:
[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\curlit.exe]
Whose value is C:\app\os\commands\links\curlit.lnk

3. Such that you can now efficiently run the command any time you like:
Win+R curlit
Which will tell you your current IP address (usually under VPN).

Two things I'd like to improve with this custom command is:
a. I'd like the report to last for ten seconds, & then close the window.
b. I'd like to have a %environmentvariable% to System32 commands.

Probably it doesn't exist, but then, why not?
o Anyway, that's why I ask if you know of a variable to %System32%.
--
Note I don't use plurals, but I put them there for easy reading.

Big Al[_5_] September 16th 20 05:53 PM

Is there a system environment variable to the System32 directory?
 
On 9/16/20 12:01 PM, this is what Arlen Holder wrote:
Is there a system environment variable to the System32 directory?
o cd %system32%

I haven't seen one but there should be, IMHO, so, maybe it exists?
o Here's, at this very moment, where I'd like to use it, for example.


Setting up a PC that BOSD'd, I just created this custom command:

1. Rightclick create a shortcut C:\app\os\commands\links\curlit.lnk
Whose TARGET is %comspec% /k %Windir%\System32\curl.exe icanhazip.com

2. Add an AppPaths key named "curlit.exe" so you can run that command:
[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\curlit.exe]
Whose value is C:\app\os\commands\links\curlit.lnk

3. Such that you can now efficiently run the command any time you like:
Win+R curlit
Which will tell you your current IP address (usually under VPN).

Two things I'd like to improve with this custom command is:
a. I'd like the report to last for ten seconds, & then close the window.
b. I'd like to have a %environmentvariable% to System32 commands.

Probably it doesn't exist, but then, why not?
o Anyway, that's why I ask if you know of a variable to %System32%.

Type SET on the command prompt and you will get a list of all variables and where they point to.
If I were to venture a guess off the top of my head %SYSTEM32%


--
Linux Mint 19.3 64bit, Dell Inspiron 5570, Quad Core i7-8550U

Arlen Holder September 16th 20 06:58 PM

Is there a system environment variable to the System32 directory?
 
On Wed, 16 Sep 2020 12:53:21 -0400, Big Al wrote:

Type SET on the command prompt and you will get a list of all variables and where they point to.
If I were to venture a guess off the top of my head %SYSTEM32%


There are default variables, such as %comspec%, which aren't in that list.
o That's the problem.

Here's that "set" list though, on Win10 current:
c:\ set
Which returns:
o ALLUSERSPROFILE=C:\ProgramData
o APPDATA=C:\Users\%username%\AppData\Roaming
o CommonProgramFiles=C:\Program Files\Common Files
o CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
o CommonProgramW6432=C:\Program Files\Common Files
o COMPUTERNAME=foo
o ComSpec=C:\Windows\system32\cmd.exe
o DriverData=C:\Windows\System32\Drivers\DriverData
o FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer
o FPS_BROWSER_USER_PROFILE_STRING=Default
o HOMEDRIVE=C:
o HOMEPATH=\Users\%username%
o LOCALAPPDATA=C:\Users\%username%\AppData\Local
o LOGONSERVER=\\%computername%
o NUMBER_OF_PROCESSORS=4
o OneDrive=C:\Users\%username%\OneDrive
o OS=Windows_NT
o Path=C:\Windows\system32;C:\Windows;C:\Windows\Sys tem32\Wbem;C:\Windows\System32\WindowsPowerShell\v 1.0\;C:\Windows\System32\OpenSSH\;C:\app\os\adk\Wi ndows Performance Toolkit\;C:\Users\%username%\AppData\Local\Microso ft\WindowsApps;
o PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WS F;.WSH;.MSC
o PROCESSOR_ARCHITECTURE=AMD64
o PROCESSOR_IDENTIFIER=AMD64 Family 16 Model 4 Stepping 2, AuthenticAMD
o PROCESSOR_LEVEL=16
o PROCESSOR_REVISION=0402
o o ProgramData=C:\ProgramData
o ProgramFiles=C:\Program Files
o ProgramFiles(x86)=C:\Program Files (x86)
o ProgramW6432=C:\Program Files
o PROMPT=$P$G
o PSModulePath=C:\Program o
Files\WindowsPowerShell\Modules;C:\Windows\system3 2\WindowsPowerShell\v1.0\Modules
o PUBLIC=C:\Users\Public
o SESSIONNAME=Console
o SystemDrive=C:
o SystemRoot=C:\Windows
o TEMP=C:\Users\%username%\AppData\Local\Temp
o TMP=C:\Users\%username%\AppData\Local\Temp
o USERDOMAIN=%computername%
o USERDOMAIN_ROAMINGPROFILE=%computername%
o USERNAME=%username%
o USERPROFILE=C:\Users\%username%
o windir=C:\Windows

There are default variables, such as %comspec%, which aren't in that list.

Arlen Holder September 16th 20 07:03 PM

Is there a system environment variable to the System32 directory?
 
On Wed, 16 Sep 2020 17:58:13 -0000 (UTC), Arlen Holder wrote:

There are default variables, such as %comspec%, which aren't in that list.


Ooops. I meant %system32% isn't in that list.
Mea culpa.

The problem is the registry AppPaths key doesn't seem to use the %PATH%.
[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\]

R.Wieser September 16th 20 09:23 PM

Is there a system environment variable to the System32 directory?
 
Arlen,

The problem is the registry AppPaths key doesn't seem to use the %PATH%.
[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\]


Thats correct. And it won't work, as a path to an executable or file,
*anywhere* else either (regardless of registry, Win+R or CMD window).

Why ? Well, just compare whats inside that "path" environment variable
with any of the other paths you've been using to refer to any (of your)
shortcuts, batchfiles, scripts, executables or other. Can you spot the
difference ?

Yep, thats the reason.

As for that %system32% variable ? You don't need it. What you *do* need
is to read up to what that %path% environment variable is for, and use it as
intended. An that means you do *not* try to use it directly.

Sorry, no "silver platter" or "spoon feeding" for you today. :-)

Regards,
Rudy Wieser




All times are GMT +1. The time now is 02:50 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2004 - 2006 PCbanter
Comments are property of their posters