Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

:foldername gives strange names?

May
318
6
Using TCC 28 or 29, if I type "dir :a" and then press tab, it gives me for example ":AddNewPrograms" that seems it does not exist.
What is my mistake?
Also, on my system it seems that the ":foldername" system works since version 23, at least the tab completion, but then it does not find directories.
Last, if it is possible, how can I add a folder, for example ":Giochi" = "C:\Games\", so that if I type "cdd :G" and then press tab it completes the name ":Giochi" and when I press Enter it goes inside "C:\Giochi".
Thank You and regards
Rodolfo Giovanninetti
 
TCC can change directory to predefined Windows Folders.

From the Help File;
Code:
You can also CD to one of the predefined Windows folders. The syntax is:
CDD :foldername

where foldername can be:

AccountPictures
AddNewProgramsFolder
AdministrativeTools
AppData
ApplicationShortcuts
AppsFolder
AppUpdatesFolder
Cache
CameraRoll
CDBurning
ChangeRemoveProgramsFolder
CommonAdminTools
CommonAppData
CommonDesktop
CommonDocuments
CommonDownloads
CommonMusic
CommonPictures
CommonPrograms
CommonRingtones
CommonStartMenu
CommonStartup
CommonTemplates
CommonVideo
ConflictFolder
ConnectionsFolder
Contacts
ControlPanelFolder
Cookies
Cookies\Low
CredentialManager
CryptoKeys
Desktop
DeviceMetadataStore
DocumentsLibrary
Downloads
dpapiKeys
Favorites
Fonts
Games
GameTasks
History
HomeGroupCurrentUserFolder
HomeGroupFolder
ImplicitAppShortcuts
InternetFolder
Libraries
Links
LocalAppData
LocalAppDataLow
MusicLibrary
MyComputerFolder
MyMusic
MyPictures
MyVideo
Nethood
NetworkPlacesFolder
OneDrive
OneDriveCameraRoll
OneDriveDocuments
OneDriveMusic
OneDrivePictures
Personal
PicturesLibrary
PrintersFolder
PrintHood
Profile
ProgramFiles
ProgramFilesCommon
ProgramFilesCommonX64
ProgramFilesCommonX86
ProgramFilesX64
ProgramFilesX86
Programs
Public
PublicAccountPictures
PublicGameTasks
PublicLibraries
QuickLaunch
Recent
RecordedTVLibrary
RecycleBinrFolder
ResourceDir
RingTones
RoamedTileImages
RoamingTiles
SavedGames
Screenshots
Searches
SearchHistoryFolder
SearchHomeFolder
SearchTemplatesFolder
SendTo
StartMenuStart Menu
Startup
SyncCenterFolder
SyncResultsFolder
SyncSetupFolder
System
SystemCertificates
SystemX86
Templates
ThisPCDesktopFolder
UsersFilesFolder
UserPinned
UserProfiles
UserProgramFiles
UserProgramFilesCommon
UsersLibrariesFolder
VideosLibrary
Windows

On my system, so as not to conflict, I create an ALIAS for each folder, with the colon at the right, for the folder that I want access to.

Example;
Code:
alias utils:=E:\Utils

I can then just type the ALIAS utils: to change to that folder.

You can also CD utils:, or CDD utils:

If I want to expand the ALIAS utils:, I just press Ctrl-W, which gives me the complete folder path.

Joe
 
Last edited:
Is this feature under an option? It's not working for me in 28 which I assume is because I've disabled something.
 
Are you referring to ALIAS expansion?

From the help file;
Expanding Aliases at the Prompt

You can expand an alias on the command line and view or edit the results by pressing Ctrl-W after typing the alias name, but before the command is executed. This replaces the alias with its contents, and substitutes values for each alias parameter, just as if you had pressed the Enter key. However, the command is not executed; it is simply redisplayed on the command line for additional editing.

Ctrl-W is especially useful when you are developing and debugging a complex alias, or if you want to make sure that an alias that you may have forgotten won't change the effect of your command.

Do you have an ALIAS for Ctrl-W defined?

On my system, I do not. Confirmed by doing;
Code:
E:\Utils>which @@ctrl-w
@@ctrl-w is an unknown command

Do you have AliasExpand assigned to Ctrl-W in the Keyboard Tab of the options dialog?

1674913406011.png


Are you using Legacy Console?

1674913968048.png


Joe
Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  29.00.17 x64   Windows 10 [Version 10.0.19044.2486]
Stand-alone TCC EXE (not under TCMD EXE)
 
I'm referring to
You can also CD to one of the predefined Windows folders. The syntax is:

CDD :foldername
This doesn't work for me and I'm assuming it's because it's controlled by some "blanket" option that I have disabled.
[c:\]ver /r

TCC 28.02.18 x64 Windows 10 [Version 10.0.19044.2486]
TCC Build 18 Windows 10 Build 19044
Registered to EVOO

[c:\]cdd :AppData
TCC: (Sys) The directory name is invalid.
":AppData"
 
I'm referring to

This doesn't work for me and I'm assuming it's because it's controlled by some "blanket" option that I have disabled.

Apologies for thinking it was about AliasExpand.

Indeed, not all of the pre-defined Window Folders work.

Some do.

Example;
Code:
E:\Utils>cdd :Fonts

C:\...\Fonts>cd
C:\Windows\Fonts

Desktop and OneDrive also work.

See if those three folders work on your system, and advise.

AddNewProgramsFolder does not work, but can be accessed via the Run Dialog;

1674931771942.png


I think that, at one time, I did know why some of the folders did not work with CDD :, but I am unable to find the thread.

I'm pretty sure it was a discussion between myself and @vefatica, but I am either imagining the discussion, or I just don't remember.

I'm pretty sure that @rconn would know, though.

Joe
 
I reckon only the ones that are directories in the file system are going to work with CDD (et al).

With (at least some) others, you can, for example, start shell:PrintersFolder.
 
Yes, :Fonts does work, thanks. So it's not that the feature isn't working, it's just that some of the documented shortcuts (e.g. :AppData) don't work.
[c:\]cd :AppData
TCC: (Sys) The directory name is invalid.
":AppData"

[c:\]cdd %APPDATA%

[c:\users\gentzel\appdata\roaming]
Does :AppData also not work in v29?
 
Yes, :Fonts does work, thanks. So it's not that the feature isn't working, it's just that some of the documented shortcuts (e.g. :AppData) don't work.

Does :AppData also not work in v29?
Interesting! Here, this works.

Code:
start shell:AppData

And these three work.

Code:
c:\users\vefatica\appdata> cdd :LocalAppData

c:\users\vefatica\appdata\local> cdd :RoamingAppData

c:\users\vefatica\appdata\roaming> cdd :LocalAppDataLow

c:\users\vefatica\appdata\locallow>
 
On my system,
this .btm;
Code:
@setlocal
@echo off
Gosub FolderList

echo Cannot  CDD : to foldername > clip1:
echo Success CDD : to foldername > clip2:

do foldername in @%_batchname:FolderNames.txt
  cdd :%foldername 2> nul
  if %? eq 2 echo Cannot cdd :%foldername >> clip1:
  if %? eq 0 echo %foldername >> clip2:
enddo

echo Clip1: contains folders that cannot be CDD :
echo Clip2: contains folders that can be CDD :
endlocal
quit

:FolderList
type <<- ENDTEXT > %_Batchname:FolderNames.txt
AccountPictures
AddNewProgramsFolder
AdministrativeTools
AppData
ApplicationShortcuts
AppsFolder
AppUpdatesFolder
Cache
CameraRoll
CDBurning
ChangeRemoveProgramsFolder
CommonAdminTools
CommonAppData
CommonDesktop
CommonDocuments
CommonDownloads
CommonMusic
CommonPictures
CommonPrograms
CommonRingtones
CommonStartMenu
CommonStartup
CommonTemplates
CommonVideo
ConflictFolder
ConnectionsFolder
Contacts
ControlPanelFolder
Cookies
Cookies\Low
CredentialManager
CryptoKeys
Desktop
DeviceMetadataStore
DocumentsLibrary
Downloads
dpapiKeys
Favorites
Fonts
Games
GameTasks
History
HomeGroupCurrentUserFolder
HomeGroupFolder
ImplicitAppShortcuts
InternetFolder
Libraries
Links
LocalAppData
LocalAppDataLow
MusicLibrary
MyComputerFolder
MyMusic
MyPictures
MyVideo
Nethood
NetworkPlacesFolder
OneDrive
OneDriveCameraRoll
OneDriveDocuments
OneDriveMusic
OneDrivePictures
Personal
PicturesLibrary
PrintersFolder
PrintHood
Profile
ProgramFiles
ProgramFilesCommon
ProgramFilesCommonX64
ProgramFilesCommonX86
ProgramFilesX64
ProgramFilesX86
Programs
Public
PublicAccountPictures
PublicGameTasks
PublicLibraries
QuickLaunch
Recent
RecordedTVLibrary
RecycleBinrFolder
ResourceDir
RingTones
RoamedTileImages
RoamingTiles
SavedGames
Screenshots
Searches
SearchHistoryFolder
SearchHomeFolder
SearchTemplatesFolder
SendTo
StartMenuStart Menu
Startup
SyncCenterFolder
SyncResultsFolder
SyncSetupFolder
System
SystemCertificates
SystemX86
Templates
ThisPCDesktopFolder
UsersFilesFolder
UserPinned
UserProfiles
UserProgramFiles
UserProgramFilesCommon
UsersLibrariesFolder
VideosLibrary
Windows
ENDTEXT
...returned these results;
Code:
Cannot cdd :AddNewProgramsFolder
Cannot cdd :AdministrativeTools
Cannot cdd :AppData
Cannot cdd :AppsFolder
Cannot cdd :AppUpdatesFolder
Cannot cdd :Cache
Cannot cdd :ChangeRemoveProgramsFolder
Cannot cdd :CommonAppData
Cannot cdd :CommonDesktop
Cannot cdd :CommonDocuments
Cannot cdd :CommonDownloads
Cannot cdd :CommonMusic
Cannot cdd :CommonPictures
Cannot cdd :CommonRingtones
Cannot cdd :CommonVideo
Cannot cdd :ConflictFolder
Cannot cdd :ConnectionsFolder
Cannot cdd :ControlPanelFolder
Cannot cdd :CredentialManager
Cannot cdd :CryptoKeys
Cannot cdd :DocumentsLibrary
Cannot cdd :dpapiKeys
Cannot cdd :Games
Cannot cdd :HomeGroupCurrentUserFolder
Cannot cdd :HomeGroupFolder
Cannot cdd :InternetFolder
Cannot cdd :MusicLibrary
Cannot cdd :MyComputerFolder
Cannot cdd :MyMusic
Cannot cdd :MyPictures
Cannot cdd :MyVideo
Cannot cdd :NetworkPlacesFolder
Cannot cdd :OneDriveCameraRoll
Cannot cdd :OneDriveDocuments
Cannot cdd :OneDriveMusic
Cannot cdd :OneDrivePictures
Cannot cdd :Personal
Cannot cdd :PicturesLibrary
Cannot cdd :PrintersFolder
Cannot cdd :PublicAccountPictures
Cannot cdd :RecordedTVLibrary
Cannot cdd :RecycleBinrFolder
Cannot cdd :RoamedTileImages
Cannot cdd :Searches
Cannot cdd :SearchHistoryFolder
Cannot cdd :SearchHomeFolder
Cannot cdd :SearchTemplatesFolder
Cannot cdd :StartMenuStart Menu
Cannot cdd :SyncCenterFolder
Cannot cdd :SyncResultsFolder
Cannot cdd :SyncSetupFolder
Cannot cdd :SystemCertificates
Cannot cdd :ThisPCDesktopFolder
Cannot cdd :UsersFilesFolder
Cannot cdd :UsersLibrariesFolder
Cannot cdd :VideosLibrary

Joe
Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  29.00.17 x64   Windows 10 [Version 10.0.19044.2486]
 
@Joe Caverly, where did your list of :dirnames come from? I think the mechanism that gave you that list isn't the same as the completion mechanism.

I think TCC is doing this bare-handed. All those names, some with two versions (with/without spaces) are hard coded in TakeCmd.dll. For example,

Code:
CommonDocuments
Common Documents

I wonder if there is a Win32 API function to resolve shell folder names to paths.
 
The list is also available when you do CD /=

Joe
 
Hmmm! I remember now. I can get user-friendly names (many with spaces) on_the_fly by looking at the data in the "Name" value in each subkey of HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions. My SHELLEX plugin can use those names to open Explorer windows; for example, shellex "shell:Common Administrative Tools".

As for CDDing to one of them ... ????

The subkeys of FolderDescriptions mentioned above have names like {FDD39AD0-238F-46AF-ADB4-6C85480369C7} (GUIDs?). But those don't seem to be paired with CSIDLs or Folder_ids anywhere in the registry. I wish I could turn those names into paths but I'm clueless.
 
The subkeys of FolderDescriptions mentioned above have names like {FDD39AD0-238F-46AF-ADB4-6C85480369C7} (GUIDs?). But those don't seem to be paired with CSIDLs or Folder_ids anywhere in the registry. I wish I could turn those names into paths but I'm clueless.

KNOWNFOLDERIDs are GUIDs. Whether they're the same as the GUIDs in the registry key, I don't know.
 
Thanks, @Charles G, for pointing me in the right direction. After struggling for about an hour with syntax, I realized that I already had a plugin @KNOWNPATH[{GUID}] (which I'll soon change to @KNOWNPATH[friendly name] where the friendly names can be dug out of the FolderNames key with my plugin SHELLEX. It's a bit convoluted. SHELLEX must go through the subkeys of FolderNames to print the names and @KNOWNPATH must also dig through them to get a GUID for a name.

For now I can dynamically get the names of 136 folders and paths for 93 of them.
 
Back
Top
[FOX] Ultimate Translator
Translate