Directory Alias Issue

Dec 2, 2008
226
2
Canada
Here is what I have setup:

Sets loaded using "set /r":

jp="C:\Documents and Settings\cgunhouse\My Documents\JPSoft"
jpB="C:\Documents and Settings\cgunhouse\My Documents\JPSoft\Batches"
jpS="C:\Documents and Settings\cgunhouse\My Documents\JPSoft\StartUp"

Aliases loaded using "alias /r":

jp:=%jp
jp=pushd %jp
jpb=pushd %jpb
jpb:=%jpb
jps=pushd %jps
jps:=%jps
edit1="%ProgramFiles%\IDM Computer Solutions\UltraEdit\Uedit32.exe"
edit2="%ProgramFiles%\IDM Computer Solutions\UltraEdit\Uedit32.exe" %@truename[%1]

Typed at command line:

edit1 jpb:\mailzipjob.btm

Command line parsed as:

"C:\Program Files\IDM Computer Solutions\UltraEdit\Uedit32.exe" jpb:\mailzipjob.btm

Editor tries to load:

C:\Documents and Settings\cgunhouse\Application Data\IDMComp\UltraEdit\jpb:\mailzipjob.btm

FILE NOT LOADED


Typed at command line:

edit2 jpb:\mailzipjob.btm

Command line parsed as:

"C:\Program Files\IDM Computer Solutions\UltraEdit\Uedit32.exe" C:\Documents and Settings\cgunhouse\My Documents\JPSoft\Batches\mailzipjob.btm

Editor loads:

C:\Documents and Settings\cgunhouse\My Documents\JPSoft\Batches\mailzipjob.btm



Now the question, is there a way to expand the directory alias before it is passed to the editor without having to use @truename?
Alias edit1 will allow me to edit more than one file on the command line but alias edit2 restricts me to one.

Craig
 
  • Like
Reactions: Charles Dye
May 20, 2008
3,515
4
Elkridge, MD, USA
Charles' answer is easy to do interactively, but not in a batch file. You could also change your alias definition to include multiple parameters:

edit5="%ProgramFiles%\IDM Computer Solutions\UltraEdit\Uedit32.exe" %@quote[%@truename[%1]] %@quote[%@truename[%2]] %@quote[%@truename[%3]] %@quote[%@truename[%4]] %@quote[%@truename[%5]]

which accepts up to 5 parameters. Note the use of @QUOTE[] - you probably do not want the embedded whitespace to be a parameter separator...

It is explicitly stated that aliases, including directory aliases, are internal to TCC - you would have to enhance NTFS itself if you wanted other programs to be able to accept them. OTOH you can just use the variables you already defined explicitly in your setup instead of directory aliases, using the same number of keystrokes:

edit1 %jpb\mailzipjob.btm

should work as intended, and you would not even need to define the directory aliases...

BTW, I use *cdd instead of pushd in my aliases to switch directories, because more often than not I do not want to return to the previous directory. When I do, I just use the - (hyphen) command, which takes me back to the last directory.
 
Dec 2, 2008
226
2
Canada
UltraEdit process the parameters without the %@quote[]

I was hoping for something like:

edit="%ProgramFiles%\IDM Computer Solutions\UltraEdit\Uedit32.exe" %@truename[%$]

But of course this doesn't work.

As for *cdd instead of pushd for the aliases I have listed in the example, the to and from my TCC batch files and support files for editting and then I usually do jump back to where I was.
 
Dec 2, 2008
226
2
Canada
Actually I came up with something a little better.

ed*it=IFF %# == 0 THEN & %UltraEdit & ELSE & for %a in ( %$ ) %UltraEdit %@truename[%a] & DELAY /M 10 & ENDIFF​

This allows for something like:

edit *.cpp *.h
and the "DELAY /M 10" is only in there because UltraEdit acts funny when it has so many command line requests thrown at it in quick succession.
 
Aug 3, 2016
376
9
Netherlands
I would suggest to use %@EXPAND, so you could open UltraEdit just once, with all the matching files as arguments.
But it turns out @EXPAND doesn't support things like :System or your jpb:
 
Similar threads
Thread starter Title Forum Replies Date
Jay Sage Directory Alias Access to FTP Servers Support 2
Joe Caverly Using a Directory Alias with @iniwrite fails Support 14
J Initialise; Alias; Extended directory search Support 2
P directory alias bug? Support 4
fishman@panix.com HELP!! I just updated to Version 28 and as usual I cannot make extended directory search work. Support 2
D How to use multi-line DO to loop through first level directory names Support 5
D ParentDirectory does not update directory history Support 6
samintz CDD to non-existent directory hangs Support 2
gworley rd (Remove Directory) gives interesting error: Support 2
D Directory History Window with wildcard search Support 3
D How to? Skip removing directory (RMDIR) without error message Support 2
gentzel Directory stack empty when running TCEXIT? Support 9
vefatica Disable extended directory searches (completely)? Support 8
M WAD "Pictures" directory is empty in TCC but not in CMD or Explorer Support 4
G Local Directory Corruption Support 11
Joe Caverly DIRectory Colorization in v25 Help File Support 0
K copy changing destination current directory Support 1
thorntonpg option /u not working The directory name is invalid Support 5
J built in file explorer - how do i go back "up" the directory? Support 2
vefatica Extended directory searches? Support 6
A Installer /extract: extracts into current directory if target not exists Support 12
Charles Dye Ctrl-Shift-Up doesn't update directory history Support 1
G Extended directory search not working Support 4
CWBillow Editing in the root directory of windows 10 Support 6
D Directory stack empty Support 1
J directory or folder to start in Support 2
M How to unlock a directory Support 1
Alpengreis Fixed TCMD FileExplorer Start-Directory problem Support 4
R V19 - At startup, TCC save directory in the directory history list Support 2
C Touch command — I Need to touch matching files in another directory. Support 5
nickles Move takecommand.18.0.key location to installation directory Support 4
fishman@panix.com Extended Directory Searches are not working for me in CDD Support 9
vefatica TCMD's current directory? Support 4
J How to set working directory Support 10
nickles How to? Follow a JUNCTION type directory link Support 9
Steve Pitts WAD Strange output from DEL of a non-existent directory Support 7
I tab completion with directory commands Support 7
vefatica Start-up directory for new tabs? Support 7
cgunhouse Problem with CALL and Directory Aliases in V17 Support 9
vefatica FFIND /S, find directory with specified name? Support 7
David Wilbanks How to make new tab open in same directory as previous tab? Support 4
H WAD Wild Card in Directory @shfolder[25] acting differently Support 3
M How to? List path getting short file and directory names... Support 10
A How to? Can't change directory ("cd") into system hidden files Support 13
mfarah How to? So I want a custom directory for the plugins... Support 16
D Why doesn't ffind find directory? Support 3
T dir /h error in empty directory Support 22
S directory history locks up TCC Support 3
B Why Does @GETDIR Repeat Selected Directory Name In Returned Value Support 7
ed neff How to? exit TCC/Take Command to a new directory Support 10

Similar threads