ZTree.com  | ZEN  | About...  

 Index   Back

C command line processing   [Zeta]

By: Ben Kent       
Date: Jan 03,2022 at 12:46
In Response to: [Bug] ztree hangs at start (Ryan)

> shortcut has
>
> AA=C:\ZTREE\ZTW.EXE /M /Y "M:\" "AAA.TXT*" /K,ENTER,f,ENTER
> BB=C:\ZTREE\ZTW.EXE /M /Y "M:" "AAA.TXT*" /K,ENTER,f,ENTER
>
> AA and BB used to work, now AA hangs ztree, and ztree doesnt respond.
> maybe Ztree could fix what windows ruined by making AA and BB work again.


From https://docs.microsoft.com/en-us/cpp/c-l...-command-line-arguments?view=msvc-170
--
A double quote mark preceded by a backslash (\") is interpreted as a literal double quote mark (").
--


i.e. we need something like this in the help file

3.13 Command-Line Options
for [paths]:, [filters]: and [/K[macro]]:
Because ZTree uses the C command line parsing libraries, if quoting, and the character before the last quote is a backslash, then the backslash needs to be escaped, like this "d:\data\\"


Many applications show the same behaviour, robocopy.exe for example.


AA will cause problems because of the C command line processing
with that commandline I get "Error: Invalid filter" on the bottom line
So ZTree isn't hung, it's telling you it's waiting for input
And after pressing any key, then this
Filter: "M:" AAA.TXT* /Kf,ENTER,ENTER"
i.e. because of how C does the command line processing ZTree thinks you have supplied an invalid filter.


So to get the root of M: instead of the current directory, you need to do one of these
C:\ZTREE\ZTW.EXE /M /Y "M:\\" "AAA.TXT*" /K,ENTER,f,ENTER
C:\ZTREE\ZTW.EXE /M /Y M:\ "AAA.TXT*" /K,ENTER,f,ENTER
C:\ZTREE\ZTW.EXE /M /Y M "AAA.TXT*" /K,ENTER,f,ENTER


For BB, the commandline works for me, maybe you have simplified to post, and missed an important part.
Why not use this? Because [A..Z] Log the specified drives.
C:\ZTREE\ZTW.EXE /M /Y M AAA.TXT* /K,ENTER,f,ENTER

Also the macro part is probably better written this way, reset the filespec, and then enter the directory. Then you will not be relying on CO-2R=Enter and Remain
/Kf,ENTER,ENTER


Ben

579 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 74 users online (0 registered, 74 guests)
Index | Admin contact |   Forum Time: Mar 29, 2024 - 8:01 am UTC  |  Hits:62,397,377  (12,163 Today )
RSS Feed