Done Support ~ and :path in COPY

samintz

Scott Mintz
May 20, 2008
1,495
16
Solon, OH, USA
The tilde shortcut is very handy. It looks like only the CD/CDD command can use it, however.

For example it would be really handy to do something like: COPY file ~\desktop. Or the :path syntax supported by CD.
e.g. copy file :Desktop
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,446
88
Albuquerque, NM
prospero.unm.edu
Not to disparage your suggestion at all, but you can use directory aliases in most file-handling commands:
Code:
C:\>alias *:
desk:=%@shfolder[16]\
dl:=%userprofile\downloads\
docs:=%@shfolder[5]\
etc:=%systemroot\system32\drivers\etc\
gd:=%userprofile\google drive\
progs:=%@shfolder[38]\
shell:=%@path[%_cmdspec]
sys:=%@shfolder[37]\
user:=%userprofile\
win:=%@shfolder[36]\

C:\>
 

samintz

Scott Mintz
May 20, 2008
1,495
16
Solon, OH, USA
The issue is that I am doing more and more work in WSL2 using bash. And the git bash prompt. And bash supports copying to and from ~ .

I am constantly messing up the / and \ in path names. And longing for the ease of doing things in TCC...
 
Not sure if this will be of any benefit, but I have tcc.exe as an alias in my Bash Profile;
Code:
alias tccrt='/mnt/c/program\ files/jpsoft/tcc_rt_27/tcc.exe /I /C'

That way, I can run a TCC command while in bash;
Code:
jlc@DESKTOP-H2JFFTF:/mnt/e/Utils$ alias tccrt
alias tccrt='/mnt/c/program\ files/jpsoft/tcc_rt_27/tcc.exe /I /C'
jlc@DESKTOP-H2JFFTF:/mnt/e/Utils$ tccrt echo %_isodate
2021-01-06
jlc@DESKTOP-H2JFFTF:/mnt/e/Utils$

Joe
 
Oct 18, 2009
362
17
Not sure if this will be of any benefit, but I have tcc.exe as an alias in my Bash Profile;
Code:
alias tccrt='/mnt/c/program\ files/jpsoft/tcc_rt_27/tcc.exe /I /C'

That way, I can run a TCC command while in bash;
Code:
jlc@DESKTOP-H2JFFTF:/mnt/e/Utils$ alias tccrt
alias tccrt='/mnt/c/program\ files/jpsoft/tcc_rt_27/tcc.exe /I /C'
jlc@DESKTOP-H2JFFTF:/mnt/e/Utils$ tccrt echo %_isodate
2021-01-06
jlc@DESKTOP-H2JFFTF:/mnt/e/Utils$

Joe
This DEFINITELY needs to be posted somewhere on the website, not just buried in a response an unrelated topic!
 
Nov 2, 2008
231
2
I use this batch file. It works under CMD etc, and not only changes to the desired directory, but you can open the folder in explorer.

You can have your own 'special' folders on top of this. This is what HKLM\Software\Wendy\Folders does. So for example, if I want to show what's in the mail-downloads, I run cdf /o email

The regkey is maintained in my setup files. It's simply a batch file, designed to connect the copied software to the shell, through reg.exe calls.

Capture.PNG


One of the joys of the private setup is I maintain my own menu, directly connected to the same folders.

Code:
:: set folders for windows 2k, xp [0config.cmd]
set zreg=Software\Wendy\Folders
...
reg add HKLM\%zreg% /f /v appdir /d %zwin%
reg add HKLM\%zreg% /f /v appdata /d %zapp%
reg add HKLM\%zreg% /f /v batch /d %zdir%\cdata\batch
reg add HKLM\%zreg% /f /v books /d %zbook%

A command "cdf batch" opens the batch file directory.

You can open the standard stuff too, such as cdf sendto

conset is Frank Westlake's utility.

Code:
@echo off
:: cd shell folder.
if /i "%1"=="/?" goto :ttyhelp
if /i "%1"=="" goto :ttyhelp
set zdir=
set zshf=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
set zapp=Software\Microsoft\Windows\CurrentVersion\App Paths
if /i "%1"=="/m" goto :hklm
if /i "%1"=="/u" goto :hkcu
if /i "%1"=="/w" goto :hkwe
if /i "%1"=="/i" goto :image
if /i "%1"=="/a" goto :happ
set zcmd=chdir
set zhere=%*
if "%1"=="/o" set zcmd=open
if "%1"=="/o" set zhere=%zhere:~3%
conset /q /k zdir=HKLM\%zshf%\%zhere%
if not "%zdir%"=="" goto :doit
conset /q /k zdir=HKCU\%zshf%\%zhere%
if not "%zdir%"=="" goto :doit
conset /q /k zdir=HKLM\Software\Wendy\Folders\%zhere%
if not "%zdir%"=="" goto :doit
goto :end

:hklm
shelexec reg:hklm\%zshf%
goto :end
:hkcu
shelexec reg:hkcu\%zshf%
goto :end
:hkwe
shelexec reg:hklm\software\wendy\folders
goto :end
:happ
shelexec reg:hklm\%zapp%
goto :end
:image
set zdir=Microsoft\Windows NT\CurrentVersion\Image File Execution Options
shelexec reg:hklm\software\%zdir%
goto :end

:ttyhelp
echo CDF changes to a directory stored in registry, or shell folder.
echo.
echo   /o  Open the named folder in explorer.
echo   /m  Display the shell folders in the machine tree
echo   /u  Display the shell folders in the user tree
echo   /w  Display the folders in HKLM\Software\Wendy\Folders
echo   /i  Display the image settings tree for hacks etc.
echo.
echo  name  Changes to first instance of name in the above order.
goto :end

:dexe
goto :end

:doit
set zcxm=
if %zcmd%==chdir cd /d %zdir%
if %zcmd%==open shelexec %zdir%
:end
set zdir=
 

Attachments

  • Capture.PNG
    Capture.PNG
    32.3 KB · Views: 52
Similar threads
Thread starter Title Forum Replies Date
Joe Caverly Have TCMD/TCC support registered version of V Suggestions 12
R Done Website home page doesn't mention MS Server 2019 support Suggestions 0
S Add support for Git auto-completion Suggestions 0
Charles Dye Done ASSOCIATE: Support other verbs Suggestions 1
D Done @expand should support directory aliases. Suggestions 0
joltcoder Done Support an "up" command to go to parent directory and "up3" to go up 3 directories, etc. Suggestions 4
M Declined Command line support for Virustotal Suggestions 0
Charles Dye Done MOUNTISO: Add support for VHD / VHDX files Suggestions 5
E Done Support for IPv6 (ping function) Suggestions 5
Charles Dye Done Support binary buffers in checksum functions Suggestions 0
vefatica Done Let WHICH support UDFs Suggestions 1
gentzel Done Support m<&n as synonym for n>&m Suggestions 0
cgunhouse Declined Support for Handling Permissions Suggestions 0
cgunhouse Declined Support for Critical Sections Suggestions 0
rconn Declined VMDK support with MOUNT Suggestions 0
rconn DROPBOX and GOOGLE DRIVE support Suggestions 1
rconn add support for batch file projects Suggestions 0
rconn Add support for backpipes Suggestions 0
rconn Done UnQlite - alternative to dBase support ? Suggestions 0
rconn Support XML environment variables Suggestions 0
rconn Declined Support JSON environment variables Suggestions 1
krischik Done Working UTF-8 Support Suggestions 11
J Done Suggestions (copied from Support Thread) Suggestions 4
S Declined Support for Enhanced Deflate in ZIP Suggestions 1
M Declined Support for UTF-8 coded files in LIST and FFIND Suggestions 0
fpefpe Done Regina Support Suggestions 2
J Declined Full support for list /c using @consoleb Suggestions 5
S Done Better PLUGIN support Suggestions 0
D Duplicate directory path and copy files and subdirectories. Suggestions 4
mfarah Done TCEDIT: show the full name (with drive and path) of the active file on the title bar. Suggestions 3
Charles Dye TCEDIT: Path search option Suggestions 1
Emilio III Done Full path with short names Suggestions 2
R Done System variable with TCC folder path Suggestions 8
mfarah "Relative path" option for PDIR Suggestions 1
M Done Verify validity of file name and/or path... Suggestions 2
C Declined Add switch to MOVE to not make empty destination folders. (COPY's /F) Suggestions 4
C Move/Copy switch not make empty destination sub-folders Suggestions 6
R Copy and Move with auto date/timestamp Suggestions 4
Alpengreis Done Preserves directory attributes for COPYDIR & COPY Suggestions 3
C Feature Request: Gain some elements of the XXCOPY feature set in COPY or a new "Mass-Copy" command Suggestions 0
R Declined wish-list: add a command to copy a file to clipboard. Suggestions 17
D Done Suggestion: keystroke to copy previous argument Suggestions 3
R Done IDE copy (OR REMOVE) Set var name to Watch list by hotkey Suggestions 2
Alpengreis Done Add "Slow copy" (/WAIT) parameter to SYNC command Suggestions 1
C Declined copy /w suggestion Suggestions 2
WinLanEm Done COPY modify Suggestions 4
rconn New parameter /WTF - COPY/MOVE - Wait on disk full (rather than halt with error) Suggestions 1
rconn Done Copy with Backup Versions Suggestions 0
S Done COPY and MOVE Suggestions 0
S Declined Enhanced @FILE for COPY, DESCRIBE, MOVE, RENAME, SYNC, TOUCH /R Suggestions 0

Similar threads