ZTree.com  | ZEN  | About...  

 Index   Back

the \" issue   [Zeta]

By: Hartmut Schneider     Germany  
Date: Nov 30,2018 at 02:14
In Response to: [Bug or ?] I need an explanation on ztw.exe c:\ and ztw.exe "c:\" (Ryan)

> But hey, interesting:
> ztw.exe "c:\\" does work.
> Why is it so?

Perhaps it has to do with the backslash at the end of the double-quoted string.

I've read a hint in the help output of SR.exe
(Search and Replace, from a friend of Michael Kahn, see http://www.ztw3.com/forum/forum_entry.php?id=79890 )

It advises to double the backslash when it's the last character in a double-quoted string:
(4)-TIPS
DOUBLE QUOTES AND BACKSLASHES ON THE COMMAND LINE.

Due to anomalies in the command line parameter retrieval mechanism
(under DOS/Windows at least) special procedure must be followed
regarding backslashes. When bracketing the target and replacement
strings with double quotes and either of the strings contain a reference
to a TRAILING backslash, then ONE EXTRA backslash must be added to the end of
that string. This because the OS strips the last one off prior to returning
the string to this program. Please see the following example:

We want to change:
C:\PROGRAM FILES\STUFF\ to C:\PROGRAM FILES\OTHERSTUFF\

The command would be:
SR "C:\\PROGRAM FILES\\STUFF\\\" "C:\\PROGRAM FILES\\OTHERSTUFF\\\"


I believe that \" is simply interpreted as a quoted " - and thus the same as if you type:
ztw.exe "c:" - which simply highlights the current dir on Drive C: (which is C:\Windows\system32 here in my CMD box).

Hartmut

42 views      
 

Messages in this Thread

 
93,933 Postings in 11,850 Threads, 347 registered users, 11 users online (0 registered, 11 guests)
Index | Admin contact |   Forum Time: Dec 10, 2018 - 3:37 pm EST  |  Hits:26,926,139  (2,607 Today )
RSS Feed