Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

SETDOS /X ?

Apr
1,808
17
I can't tell what the setdos /x value is so a BTM can work with files with "%" in the name?

Code:
COMMENT

        :: RunMe.btm

ENDCOMMENT

del /a:d /s /e /x /y *
Global /H /I /N /Q ( for %fn in (*) Gosub Dofile )
del /a:d /s /e /x /y *

QUIT

:Dofile
    set uExt=%@upper[%@ext["%fn"]]
    for /l %n in (1,1,9999) (
        iff not isfile "c:\ZZ_GM_PICS\%[uExt]_%@format[04,%n]\%fn" then
            move /a: /e /h /md "%fn" "c:\ZZ_GM_PICS\%[uExt]_%@format[04,%n]\"
            leavefor
        endiff
    )
    return
 
Try SETDOS /X-3
Code:
R:\>dir this*

 Volume in drive R is unlabeled    Serial number is c062:deee
 Directory of  R:\this*

2023-03-17  13:31               6  This%That.txt

R:\>setdos /x-3

type "This%That.txt"
Test

setdos /x+3

R:\>type "This%That.txt"
TCC: (Sys) The system cannot find the file specified.
 "R:\This.txt"

Ref: _EXPANSION
Ref: SETDOS

Added: Note that %_expansion will return %_expansion if you turn off variable expansion (setdos /x-3)!

Joe
 
This works as well;
Code:
R:\>type This^%That.txt
Test

R:\>type "This%That.txt"
TCC: (Sys) The system cannot find the file specified.
 "R:\This.txt"

Ref: Escape Character

Joe
 
Try SETDOS /X-3
Code:
R:\>dir this*

 Volume in drive R is unlabeled    Serial number is c062:deee
 Directory of  R:\this*

2023-03-17  13:31               6  This%That.txt

R:\>setdos /x-3

type "This%That.txt"
Test

setdos /x+3

R:\>type "This%That.txt"
TCC: (Sys) The system cannot find the file specified.
 "R:\This.txt"

Ref: _EXPANSION
Ref: SETDOS

Added: Note that %_expansion will return %_expansion if you turn off variable expansion (setdos /x-3)!

Joe

The help says:

"All variable expansion (includes environment variables, batch file parameters, variable function evaluation, and alias parameters)"

Wouldn't that effect the use of % in my BTM - i.e. %fn and %uExt - not just the contents of the two vars?
 
Here is a list of some of the filenames that are not processed by the BTM I posted in the first message above - adding SETDOS /x-3

Code:
064-OE Classic 30% Black Friday Deal (48 hours only).eml
284131803msatinne%m2iFrfeopcxu.sqlite
549939322msaeihnc%a2eFrfbx-mro.sqlite
727688008bsleotcakcliifsittsr%.sqlite
911854228msaeiinr%a2nFoliatncg.sqlite
1039479565meapiinc%e2rF-preerds.sqlite
1059394878bslnoicgkullipsFt2s%.sqlite
1120544067mganiind%r2aFoobn.sqlite
1397314265mpaoitny%p2pFit.sqlite
1563863681mnaoiint%a2cFisfiitse.sqlite
1725441852bxlfogcFk2l%isst.sqlite
3345959086bslnoocdkdlaiFs2t%s.sqlite
3899588440psinninpiFn2g%.sqlite
4184564211msaliend%o2mF-preerds.sqlite
4187298971mraficnF%2.sqlite
4219953499msafienr%p2-Ftreokc.sqlite
 
You can try SETDOS /X-2 to disable nested variable expansion. However, I think filenames containing percent signs are always going to pose a challenge.
 
so change /x-3 to /x-2 ? sorry for not beeing totally awake
 
and i want to keep the filename such as it is... bu I really do like the the current FIXNAMES - just not for this use
 
Back
Top