Add a new TC environment var. %$DOWNLOADS%

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Jivan_Mukta
Junior Member
Junior Member
Posts: 28
Joined: 2013-09-23, 19:25 UTC

Add a new TC environment var. %$DOWNLOADS%

Post by *Jivan_Mukta »

Like currently existing %$DESKTOP%, %$MYMUSIC%, %$MYVIDEO%, etc.

%$DOWNLOADS% will be much better than %USERPROFILE%\Downloads
because somebody could change the standard place by the win settings
to save more free space on the system drive.

I hope it is easy to realize TC takeing the win registry value like the standard command line
REG query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "{374DE290-123F-4565-9164-39C4925E467B}"

Otherwise the idea can be realized by runing TC in a batch file

Code: Select all

FOR /F "tokens=2* delims= " %%A in ('REG query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "{374DE290-123F-4565-9164-39C4925E467B}"') do SET TCdownloads=%%B

START /D"Path to TC" TOTALCMD%PROCESSOR_ARCHITECTURE:~3,2%.EXE /S %1 %2
After that the command CD %TCdownloads% will work.

See also
http://www.reddit.com/r/learnpython/comments/4dfh1i/how_to_get_the_downloads_folder_path_on_windows/
Skif_off
Member
Member
Posts: 132
Joined: 2013-09-30, 13:13 UTC

Post by *Skif_off »

AFAIR "{374DE290-123F-4565-9164-39C4925E467B}" works with WinVista and higher and TC uses CSIDL.

For Directory Hotlist you can try TCShellCD:

Code: Select all

TCShellCd.exe HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\{374DE290-123F-4565-9164-39C4925E467B}
Or script (VBS, AutoHotkey, AutoIt).

If you want environment variable then try Autorun:

Code: Select all

...
LoadLibrary Plugins\Autorun_Sysinfo.dll
...
If %OSVer% <> 2000 Or %OSVer% <> XP Or %OSVer% <> 2003 Or %OSVer% <> 2003R2 Then
  RegRead Down "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "{374DE290-123F-4565-9164-39C4925E467B}"
  SetEnv Downloads %Down%
EndIf
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

The current system called registry env. strings is based on so called CSIDL identifiers. Since Windows Vista there is a new system called 'known folders'. While 'Downloads' is defined as a known folder there is no equivalent in the CSIDL system ( see: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457%28v=vs.85%29.aspx ).

Introduction to known folders:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb776911%28v=vs.85%29.aspx

Adopting the new system would add quite a few possibilities.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6490
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

Lefteous wrote:The current system called registry env. strings is based on so called CSIDL identifiers. Since Windows Vista there is a new system called 'known folders'. While 'Downloads' is defined as a known folder there is no equivalent in the CSIDL system ( see: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457%28v=vs.85%29.aspx ).

Introduction to known folders:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb776911%28v=vs.85%29.aspx

Adopting the new system would add quite a few possibilities.
For me
TCShellCd.exe HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\{374DE290-123F-4565-9164-39C4925E467B}
works fine under Windows 10 x64
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
Jivan_Mukta
Junior Member
Junior Member
Posts: 28
Joined: 2013-09-23, 19:25 UTC

Post by *Jivan_Mukta »

I see CSIDL standard is a restriction.

So I realize in *.ini

Code: Select all

[em_currentuser_Downloads]
;cmd=cd %USERPROFILE%\Downloads
cmd=%Commander_Path%\TCShellCd.exe HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\{374DE290-123F-4565-9164-39C4925E467B}
menu=Current user downloads
and it works fine.

I hope TCShellCd.exe will not be rejected by AntiVirus software, like TCMC.exe.

Thanks a lot for explanations and suggestions!
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2Horst.Epp
For me
TCShellCd.exe HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\{374DE290-123F-4565-9164-39C4925E467B}
works fine under Windows 10 x64
What is your point?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6490
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

Lefteous wrote:2Horst.Epp
For me
TCShellCd.exe HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\{374DE290-123F-4565-9164-39C4925E467B}
works fine under Windows 10 x64
What is your point?
Because you said:
Since Windows Vista there is a new system called 'known folders'. While 'Downloads' is defined as a known folder there is no equivalent in the CSIDL system
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2Horst.Epp
Since Windows Vista there is a new system called 'known folders'. While 'Downloads' is defined as a known folder there is no equivalent in the CSIDL system
Which is correct - isn't it?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6490
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

Lefteous wrote:2Horst.Epp
Since Windows Vista there is a new system called 'known folders'. While 'Downloads' is defined as a known folder there is no equivalent in the CSIDL system
Which is correct - isn't it?
:oops:
:D
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
Skif_off
Member
Member
Posts: 132
Joined: 2013-09-30, 13:13 UTC

Post by *Skif_off »

Sorry, I lost one string :(, it will be correctly:

Code: Select all

...
LoadLibrary Plugins\Autorun_Sysinfo.dll
...
StrMid OSVer %SYSINFO_OSVERSION% 5
If %OSVer% <> 2000 Or %OSVer% <> XP Or %OSVer% <> 2003 Or %OSVer% <> 2003R2 Then
  RegRead Down "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "{374DE290-123F-4565-9164-39C4925E467B}"
  SetEnv Downloads %Down%
EndIf
Post Reply