How to? Handling filenames with blanks at command line

Sep 11, 2009
32
0
Portland, Or.
I often use the command line to view (read, watch, etc) files by issuing "START fn".

When the 'fn' is long, I enter it as "START *unique", hit TAB and TC fills in the full name (based on the unique character identifying the file) - with the proper quotes around the filename when there are blanks in the name.

BUT, upon hitting the enter key, TC opens a new session of TC - title of that filename - but does not start the operation..

IF I rename the file such that blanks become, say, underscores.. it works as expected. Since TC added those quotes, I assume that the quoted string should have been treated as an complete file than to START..

Am I missing some understanding or is this a bug in my TC v11.0 ?

Thanks,
Bob K.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,466
88
Albuquerque, NM
prospero.unm.edu
Try
Code:
start /pgm "filename with spaces"
Or
Code:
start "" "filename with spaces"

Like a number of other annoyingly dumb features, this syntax is for CMD.EXE compatibility. Being basically lazy, I prefer to

Code:
alias s=start /pgm
 
Dec 29, 2009
32
0
Atlanta, GA
I use this one frequently:
Code:
alias run=`(for %ff in (%$) echo %ff) & (for %ff in (%$) do %@QUOTE[%ff])`

It's useful because I can type "run *something*" and run the one file, or even many files. The alias is broken up into two for-loops for a reason: if it starts spewing more than I expected, I can generally break out of it before too much gets started.
 
Similar threads
Thread starter Title Forum Replies Date
C handling percent signs in filenames Support 2
C handling percent signs in filenames Support 1
vefatica WAD TCC: inconsistent character handling Support 11
M Handling of %~I problem Support 4
J File explorer handling from command line? Support 2
forbin Strange handling of [nonbright] magenta background (v22) Support 2
T WAD Difference between TCC and CMD in handling multi-command lines Support 6
thorntonpg Handling files with embedded spaces Support 1
J junction copy/move handling Support 6
C How to? MOVE and handling out of space Support 2
The Wizard WAD Possible Incorrect COMSPEC handling Support 2
Frank WAD handling variables with $-prefix Support 14
A Discrepancy in handling of "can't copy or move file to itself" Support 4
M How to? A question about error-handling... Support 25
S Description handling Support 3
B Strange handling of a .BAT file Support 5
S Ctrl-C handling while piping Support 0
vefatica Icon handling in b153 Support 7
U An annoying bug with TCC's icon handling in the taskbar Support 25
p.f.moore Bug in plugin break handling? Support 0
p.f.moore Error handling in plugins Support 2
Phileosophos PDIR to list filenames without extensions? Support 2
D How to? Filenames with "&" character Support 3
fpefpe How to? processing filenames Support 6
C Filenames with ";" Support 13
E Fixed DEDUPE doesn't handle filenames with whitespace properly when symlinking Support 1
mikea How to? Problem with @SFN (short filenames) Support 6
A CDD and DOS filenames Support 1
A How to? Work with Filenames Containing Brackets "[" and "]" Support 2
C How to? Replace &'s in filenames / FixNames.dll Support 2
J Fixed Filename completion does not quote filenames containing ^ Support 1
T Square brackets in filenames Support 1
JohnQSmith Filenames with semicolons Support 5
P Support for national letters in filenames in ftp operations Support 1
N Problems with backquotes in filenames Support 17
S Suggestion: enhanced automatic quoting of filenames Support 2
S PDIR has trouble processing filenames with embedded percent sign Support 3
B Problems with %-sign in filenames/directory names Support 6
Jay Sage Dealing With Filenames Containing Slash Character Support 5
A Color in filenames in listview Support 1
fpefpe How to? Comparing strings with blanks Support 5
S blanks in environment variable paths Support 4
M Padding with blanks... Support 4
M Concatenating blanks to strings???? Support 2

Similar threads