ZTree.com  | ZEN  | About...  

 Index   Back

[Q] comparison of OS Variables ~f1 ~d1 ~p1 ~n1 ~x1 ~s1 in F9 ztreemenu   [Q]

By: Ryan       
Date: Oct 18,2022 at 01:36

this is a script from F9 ztreemenu to compare OS with Ztree variables

::OS Variables ~f1 ~d1 ~p1 ~n1 ~x1 ~s1
::(@echo off
@echo off
ECHO %%%%0 = %0
ECHO %%%%~f0 = %~f0
ECHO ---------------------------------
ECHO 1 full path = %%%%~f0 = %~f0
ECHO 2 drive = %%%%~d0 = %~d0
ECHO 3 full dir = %%%%~p0 = %~p0
ECHO 4 file name = %%%%~n0 = %~n0
ECHO 5 file ext = %%%%~x0 = %~x0
ECHO 6 path+sname = %%%%~s0 = %~s0
ECHO.
ECHO full dir path = %%%%~dp0 = %~dp0
ECHO filename = %%%%~nx0 = %~nx0
ECHO.
ECHO ***********************************************************
ECHO ***********************************************************
ECHO %%%%1 = %1
ECHO %%%%~f1 = %~f1
ECHO ---------------------------------
ECHO 1 full path = %%%%~f1 = %~f1
ECHO 2 drive = %%%%~d1 = %~d1
ECHO 3 full dir = %%%%~p1 = %~p1
ECHO 4 file name = %%%%~n1 = %~n1
ECHO 5 file ext = %%%%~x1 = %~x1
ECHO 6 path+sname = %%%%~s1 = %~s1
ECHO.
ECHO full dir path = %%%%~dp1 = %~dp1
ECHO filename = %%%%~nx1 = %~nx1
ECHO shortname = %%%%~fs1 = %~fs1
ECHO fullname = %%%%~ftza1= %~ftza1
ECHO.
ECHO ***********************************************************
ECHO equivalent ZTREE VARIABLES %%%%1 %%%%2 %%%%3... but not the same
ECHO.
ECHO 1 full path = %%%%1 = %1
ECHO 2 drive = %%%%2 = %2
ECHO 3 full dir = %%%%3 = %3
ECHO 4 file name = %%%%4 = %4
ECHO 5 file ext = %%%%5 = %5
ECHO 6 current dir= %%%%6 = %6
ECHO.
ECHO 7 short full path = %%%%7 = %7
ECHO 8 short file name = %%%%8 = %8
ECHO.
::) 1>m:\112.txt
pause




the answer i get from the above

%0 = C:\Users\AAA\AppData\Local\Temp\ZTMP000\ZTW_MENU.BAT
%~f0 = C:\Users\AAA\AppData\Local\Temp\ZTMP000\ZTW_MENU.BAT
---------------------------------
1 full path = %~f0 = C:\Users\AAA\AppData\Local\Temp\ZTMP000\ZTW_MENU.BAT
2 drive = %~d0 = C:
3 full dir = %~p0 = \Users\AAA\AppData\Local\Temp\ZTMP000\
4 file name = %~n0 = ZTW_MENU
5 file ext = %~x0 = .BAT
6 path+sname = %~s0 = C:\Users\AAA\AppData\Local\Temp\ZTMP000\ZTW_MENU.BAT

full dir path = %~dp0 = C:\Users\AAA\AppData\Local\Temp\ZTMP000\
filename = %~nx0 = ZTW_MENU.BAT

***********************************************************
***********************************************************
%1 = "M:\11 11\22 22\CC CC.txt"
%~f1 = M:\11 11\22 22\%1
---------------------------------
1 full path = %~f1 = M:\11 11\22 22\%1
2 drive = %~d1 = M:
3 full dir = %~p1 = \11 11\22 22\
4 file name = %~n1 = %1
5 file ext = %~x1 =
6 path+sname = %~s1 = M:\11 11\22 22\%1

full dir path = %~dp1 = M:\11 11\22 22\
filename = %~nx1 = %1
shortname = %~fs1 = M:\11 11\22 22\%1 not a shortname like name~01.txt
fullname = %~ftza1= M:\11 11\22 22\%1

***********************************************************
equivalent ZTREE VARIABLES %1 %2 %3... but not the same

1 full path = %1 = "M:\11 11\22 22\CC CC.txt"
2 drive = %2 = M
3 full dir = %3 = "\11 11\22 22"
4 file name = %4 = "CC CC"
5 file ext = %5 = txt
6 current dir= %6 = "22 22"

7 short full path = %7 = "M:\11 11\22 22\CC CC.txt" not a shortname like name~01.txt
8 short file name = %8 = "CC CC.txt"

why does %1 appear?
so you CAN'T really use these OS variables ~f1 ~d1 ~p1 ~n1 ~x1 ~s1 in Ztree, is that right?

%a %d %s %n %e %p %r %v dont have ~, so why cant i use ~f1 ~d1 ~p1 ~n1 ~x1 ~s1 while
~f0 ~d0 ~p0 ~n0 ~x0 ~s0 work.

383 views      
 

Messages in this Thread

 
96,640 Postings in 12,231 Threads, 350 registered users, 65 users online (0 registered, 65 guests)
Index | Admin contact |   Forum Time: Apr 12, 2024 - 2:49 pm UTC  |  Hits:62,818,197  (13,728 Today )
RSS Feed