Brother namajm, is the code in F11 a test error code or a correct code?
I tested here and it didn't pass. It shows "ab" instead of the "ab c" we want. I don't know why.
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
@echo off
setlocal ENABLEDELAYEDEXPANSION
set str=c:\ab c\def\gh .exe\
set num=1
for /l %%i in (1,1,%num%) do set "str=!str:*\=!"
echo %str:\= && 2>nul cd %
pause
Originally posted by 3742668 at 2006-10-21 07:35:
Take a look at the <Help and Support> more.
Different combinations have different flavors, which is also one of the reasons why scripts exist:
Several methods are used in different situations, and as for which is better or worse, that is a matter of personal opinion.
Originally posted by namejm at 2006-10-21 08:39:
I found that in the sentence "echo %str:\= && 2>nul cd %", replacing "cd" with any command can execute correctly. I can't figure out the writing method of removing the last few \-separated contents. I still need to ask 37426...
set "command=set i=3"
echo i的值:%i% & pause
%command%
echo i的值:%i% & pause
Originally posted by 3742668 at 2006-10-21 09:00:
I remember that a similar method was used in that post discussing encryption and decryption.
The principle is very simple, for example:
set "command=set i=3"
echo i的值:%i% & pause
%command%
ech ...