Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

for in CMD scripts

- - - - -

  • Please log in to reply
22 replies to this topic

#1
DosCode

DosCode

    Newbie

  • Member
  • 47 posts
  • Joined 15-February 12
  • OS:none specified
  • Country: Country Flag
Hello,
I try to be as sort as possible.

I try to do some code in batch and cmd.exe (running Windows). Nwo I try the basic: I try to echo subdirectories listed in a folder.

for /r %%x in (.\www.slv.dk\Dokumenter\dsweb\Get) do echo "%%x\"

This should list the directories in Get folder. I know there is a bug, because I got this list of files as output:

C:/program files/GnuWin32/bin/./www.slv.dk/Dokumenter/dsweb/Get/
C:/program files/GnuWin32/bin/www.slv.dk/./www.slv.dk/Dokumenter/dsweb/Get/
C:/program files/GnuWin32/bin/www.slv.dk/Dokumenter/./www.slv.dk/Dokumenter/dsweb/Get/

Once again:
C:/program files/GnuWin32/bin/./www.slv.dk/Dokumenter/dsweb/Get/
C:/program files/GnuWin32/bin/www.slv.dk/./www.slv.dk/Dokumenter/dsweb/Get/
C:/program files/GnuWin32/bin/www.slv.dk/Dokumenter/./www.slv.dk/Dokumenter/dsweb/Get/

The marked text is incorrect / non-existing path.
It means there is added "./www.slv.dk/Dokumenter/dsweb/Get/" on end of %%x variable.
But I don't understand why there is listed:
C:/program files/GnuWin32/bin/www.slv.dk/
and
C:/program files/GnuWin32/bin/www.slv.dk/Dokumenter/
instead of the /Get directory???

I would expect something like this:
C:/program files/GnuWin32/bin/./www.slv.dk/Dokumenter/dsweb/Get/Document-900
C:/program files/GnuWin32/bin/./www.slv.dk/Dokumenter/dsweb/Get/Document-901
C:/program files/GnuWin32/bin/./www.slv.dk/Dokumenter/dsweb/Get/Document-902
etc

Is there any simple solution how to make the for echo correct folders? The echo command is just 1st step; I would change it later to this command
rename %%x\BG_AD_3_BG*.pdf _*.pdf



How to remove advertisement from MSFN

#2
allen2

allen2

    Not really Newbie

  • Member
  • PipPipPipPipPipPipPip
  • 1,814 posts
  • Joined 13-January 06
For /R doesn't do what you think it does: Read the help there.

#3
DosCode

DosCode

    Newbie

  • Member
  • 47 posts
  • Joined 15-February 12
  • OS:none specified
  • Country: Country Flag
Oops. Thanx for help. It works. I got the command that I needed to rename my files.

@Echo off
cls
echo on
for /r ".\www.slv.dk\Dokumenter\dsweb\Get" %%x in (.) do rename %%x\BG_AD_3_BG*.pdf _*.pdf & pause
pause

I originally wanted to rename *.pdf files and remove the BG_AD_3_BG string from begin of the name.

#4
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,596 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

I'd suggest something more along these lines:
@ECHO OFF & SETLOCAL ENABLEEXTENSIONS

REM Path to parent directory for recursion

(SET _P=WWW.SLV.DK\DOKUMENTER\DSWEB\GET)

REM Old filename string to replace

(SET _O=BG_AD_3_BG)

REM New filename string to add

(SET _N=_)

IF NOT EXIST "%_P%" GOTO :EOF

IF /I NOT "%CD%"=="%_P%" (PUSHD %_P% && SET "_=T")

FOR /D /R %%# IN (*) DO REN "%%#\%_O%*.PDF" "%_N%*.pdf"

IF %_%==T POPD

PAUSE


#5
DosCode

DosCode

    Newbie

  • Member
  • 47 posts
  • Joined 15-February 12
  • OS:none specified
  • Country: Country Flag
But this is more hard to remmeber. The command before is very simple.

Can I ask you what does mean
"%_P%"
"%CD%"
PUSHD
SET "_=T"
FOR /D
T POPD
?

#6
DosCode

DosCode

    Newbie

  • Member
  • 47 posts
  • Joined 15-February 12
  • OS:none specified
  • Country: Country Flag
It doesn't work for me. It looks that the last part of command
rename _K_ENR_*.PDF" "_*.pdf"
doesn't work.

Four last lines from the screen output:
c:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get>REN "c:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-6464\_K_ENR_*.PDF" "_*.pdf"

c:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get>REN "c:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-8808\_K_ENR_*.PDF" "_*.pdf"

c:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get>IF T == T POPD

c:\program files\GnuWin32\bin>PAUSE
Press any key to continue...

Edited by DosCode, 16 February 2012 - 06:15 AM.


#7
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,596 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

'The command before' is simply bad.

You don't have to remember it, it's written down! All you need to do is change the three lines according to your specification, (lines 3, 5 and 7), which I completed for you for your particular situation.

I'm not going to explain the basic questions you've asked, (you can learn the majority of these within the console window itself). Suffice it to say if you are asking these questions, you should certainly not be in a position to suggest that your effort is in some way better than mine.

<Edit />
I didn't change the functionality of what you asked, I simply fixed the poor example you gave. You provided the RENAME command you wanted to use, if that was incorrect too then you cannot pass the blame onto me. The output you have provided is EXACTLY what is intended according to your request.

If you wish something different, I'd suggest you provide us with your actual file/directory structures and names and an actual example of what you are wishing to change. That way we can create something specific to your situation.

#8
DosCode

DosCode

    Newbie

  • Member
  • 47 posts
  • Joined 15-February 12
  • OS:none specified
  • Country: Country Flag
List of files
C:\program files\GnuWin32\bin\wget.exe
C:\program files\GnuWin32\bin\www.slv.dk
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-10698
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-11344
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-11345
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-11346
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1402
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1403
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1404
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1405
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1406
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1407
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1408
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1409
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1410
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1411
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1412
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1413
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1414
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1415
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1416
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1417
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1421
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1422
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1423
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1424
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1426
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1427
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1428
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1429
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1430
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1431
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1432
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1433
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1434
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1435
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1436
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1437
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-6463
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-6464
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-8808
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-10698\_K_ENR_3_6_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-11344\_K_ENR_6_LAS_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-11345\_K_ENR_6_UAS_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-11346\_K_ENR_6_HMR_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1402\_K_ENR_0_6_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1403\_K_ENR_1_1_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1404\ENR_1_10_amdt_7_2004_8JUL.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1405\_K_ENR_1_11_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1406\enr_1_12.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1407\_K_ENR_1_13_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1408\_K_ENR_1_14_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1409\_K_ENR_1_2_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1410\enr_1_3.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1411\enr_1_4.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1412\ENR_1_5_AMDT_2_2004_19FEB.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1413\_K_ENR_1_6_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1414\enr_1_7.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1415\_K_ENR_1_8_en_02_07_AIRAC.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1416\_K_ENR_1_9_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1417\_K_ENR_2_1_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1421\_K_ENR_3_3_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1422\_K_ENR_3_4_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1423\_K_ENR_3_5_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1424\_K_ENR_4_1_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1426\enr_4_2.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1427\_K_ENR_4_3_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1428\_K_ENR_4_4_en_10_07.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1429\_K_ENR_5_1_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1430\_K_ENR_5_2_en_03_07_pdf.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1431\_K_ENR_5_3_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1432\_K_ENR_5_4_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1433\_K_ENR_5_5_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1434\enr_5_6.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1435\_K_ENR_6_1_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1436\enr62-1.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1437\enr62-3.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-6463\_K_ENR_3_1_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-6464\_K_ENR_3_2_en.pdf
C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-8808\_K_ENR_2_2_en.pdf

There are files like _K_ENR_1_6_en.pdf where I want to remove the _K_ENR_ sting from name of file.

Thanks.

#9
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,156 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

There are files like _K_ENR_1_6_en.pdf where I want to remove the _K_ENR_ sting from name of file.


Do you want to remove it or change it to something else (and if this is the case) is the something else "fixed" or variable?

I.e. C:\program files\GnuWin32\bin\www.slv.dk\Dokumenter\dsweb\Get\Document-1413\_K_ENR_1_6_en.pdf should become:

  • 1_6_en.pdf
  • <somethingelse>1_6_en.pdf
Example (remove _K_ENR_ only )

@ECHO OFF
SETLOCAL ENABLE EXTENSIONS
FOR /F "tokens=* delims=" %%A IN ('DIR /B /S *.pdf') DO CALL :rename "%%A"
GOTO :EOF
:rename
SET filename=%~n1
SET Newfilename=%filename:_K_ENR_=%
ECHO %1
ECHO "%~dp1%Newfilename%%~x1"
GOTO :EOF

jaclaz

Edited by jaclaz, 16 February 2012 - 07:59 AM.


#10
DosCode

DosCode

    Newbie

  • Member
  • 47 posts
  • Joined 15-February 12
  • OS:none specified
  • Country: Country Flag
Yes I want to remove it. I originally didn't find how to do it, so I tried to replace it for "_" but the best solution would be to remove it.

#11
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,156 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Yes I want to remove it.

Then you have an example to work on. :)

jaclaz

#12
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,596 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

@ECHO OFF
SETLOCAL ENABLE EXTENSIONS
FOR /F "tokens=* delims=" %%A IN ('DIR /B /S *.pdf') DO CALL :rename "%%A"
GOTO :EOF
:rename
SET filename=%~n1
SET Newfilename=%filename:_K_ENR_=%
ECHO %1
ECHO "%~dp1%Newfilename%%~x1"
GOTO :EOF


I think I'd be a little more specific with the for/call output:
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
FOR /F "TOKENS=*" %%# IN ('DIR/B/S/A-D "_K_ENR_*.pdf"') DO CALL :RN "%%#" "%%~nx#"
PAUSE
GOTO :EOF
:RN
SET "_FN=%~2"
ECHO=REN %1 "%_FN:~7%"


#13
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,156 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

I think I'd be a little more specific with the for/call output:


Sure :).
The idea of an example is that of an example. IMHO, not that of a "refined" solution.

jaclaz

#14
DosCode

DosCode

    Newbie

  • Member
  • 47 posts
  • Joined 15-February 12
  • OS:none specified
  • Country: Country Flag
Thanks.

I think I'd be a little more specific with the for/call output:

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
FOR /F "TOKENS=*" %%# IN ('DIR/B/S/A-D "_K_ENR_*.pdf"') DO CALL :RN "%%#" "%%~nx#"
PAUSE
GOTO :EOF
:RN
SET "_FN=%~2"
ECHO=REN %1 "%_FN:~7%"


The last line was not working for me. Nothing happened. But when I removed the "ECHO=" files are renamed correctly.

#15
5eraph

5eraph

    Update Packrat

  • MSFN Sponsor
  • 1,180 posts
  • Joined 04-July 05
  • OS:XP Pro x64
  • Country: Country Flag

Donator

The last line was not working for me. Nothing happened. But when I removed the "ECHO=" files are renamed correctly.

That was the point—so you could see and verify that the commands would be correct when run before committing to them.

Edited by 5eraph, 16 February 2012 - 04:42 PM.


#16
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,596 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

I'd suggest that you also remove the PAUSE now that you're happy with the result.

#17
DosCode

DosCode

    Newbie

  • Member
  • 47 posts
  • Joined 15-February 12
  • OS:none specified
  • Country: Country Flag
The pause is good. I will use the script more times, so to be sure the path is OK.

Note: The script sometimes leave extra _ in begin of filename and sometimes it removes one more letter (that should not be deleted) from begin of string. The second problem is not often, so not much problem. I don't want to bother you with it. But I have one more question I need to ask, in different thread.

Edited by DosCode, 16 February 2012 - 05:18 PM.


#18
DosCode

DosCode

    Newbie

  • Member
  • 47 posts
  • Joined 15-February 12
  • OS:none specified
  • Country: Country Flag
Right now this happened to me with these files:
gen_0_3.pdf
gen_2_1.pdf
gen_4_1.pdf
gen_4_2.pdf

so the
FOR /F "TOKENS=*" %%# IN ('DIR/B/S/A-D "gen_*.pdf"') DO CALL :RN "%%#" "%%~nx#"
GOTO :BREAK
:RN
SET "_FN=%~2"
::ECHO=
REN %1 "%_FN:~7%"
:BREAK
causes they are renamed to
.pdf
.pdf
.pdf
.pdf

Edited by DosCode, 18 February 2012 - 04:34 PM.


#19
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,596 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

Those files don't follow your original specification!

This may suffice for that scenario:
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
FOR /F "TOKENS=*" %%# IN ('DIR/B/S/A-D "gen_*.pdf"') DO CALL :RN "%%#" "%%~nx#"
GOTO :EOF
:RN
SET "_FN=%~2"
REN %1 "%_FN:~4%"


#20
DosCode

DosCode

    Newbie

  • Member
  • 47 posts
  • Joined 15-February 12
  • OS:none specified
  • Country: Country Flag
Does the number "4" at last line mean how the search string is long? I mean gen_ has 4 letters

Edited by DosCode, 18 February 2012 - 05:12 PM.


#21
dencorso

dencorso

    Iuvat plus qui nihil obstat

  • Supervisor
  • 6,217 posts
  • Joined 07-April 07
  • OS:98SE
  • Country: Country Flag

Donator

With all due respect, DosCode, what you're interested in are "CMD Scripts", not "DOS Batch Files". Your insistence in using "DOS batch" in the titles of your threads is misleading, so please do use "CMD Script" not "DOS Batch" for any new topic you start in the future. Thanks.

#22
bphlpt

bphlpt

    MSFN Addict

  • Member
  • PipPipPipPipPipPipPip
  • 1,905 posts
  • Joined 12-May 07
  • OS:none specified
  • Country: Country Flag

Does the number "4" at last line mean how the search string is long? I mean gen_ has 4 letters


I believe that you have already been referred to the website "ss64.com", but you might want to read this page - http://ss64.com/nt/s...-substring.html - which explains in detail how to "extract part of a variable (substring)".

Cheers and Regards

Posted Image


#23
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,596 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

Does the number "4" at last line mean how the search string is long? I mean gen_ has 4 letters

From:
SET /?

%PATH:~10,5%

would expand the PATH environment variable, and then use only the 5 characters that begin at the 11th (offset 10) character of the expanded result. If the length is not specified, then it defaults to the remainder of the variable value






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users