![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
![]()
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. |
Ads |
#2
|
|||
|
|||
![]()
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 |
#3
|
|||
|
|||
![]()
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. |
#4
|
|||
|
|||
![]()
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\] |
#5
|
|||
|
|||
![]()
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 |
Thread Tools | |
Display Modes | Rate This Thread |
|
|