what am I missing

September 28, 2010 at 11:39:21
Specs: Windows XP
can not get
set _name__=%_name_p:--*=4%%%~n1
to work

::take name -test--Nameing--copyid.p
::cut the -test-- off
::prep for the after the nameing--*
::cuting after the nameing--*
::move the doc to the loding


set _name_p=%~n1
set _name_p=%_name_p:*--=%
set _name__=%_name_p:*--=4%
call set _name_p=%%_name_p:%_name__%=%%
move %1 N:\etexts\--test\#Que\#1_star\%_name_p%%~x1
echo %_name_p%
pause


See More: what am I missing

Report •

#1
September 29, 2010 at 17:55:39
How can you expect "4" to be in the string if its a substring?


set _name_p=%~n1
rem ^I'm guessing  this means "-test--Nameing--copyid"

set _name_p=%_name_p:*--=%
rem ^ Nameing--copyid


set _name__=%_name_p:*--=4%
rem ^ 4copyid

call set _name_p=%%_name_p:%_name__%=%%
rem ^ remove "4copyid" from "Nameing--copyid" ??????????



Report •

#2
October 1, 2010 at 16:10:39
I just need the name left

Report •

#3
October 1, 2010 at 20:12:01
I'm not sure exactly what you mean....


If you only want the "naming" part this may help:

set _name_p=%~n1
set _name_p=%_name_p:*--=%
call set _name_p=%%_name_p:--%_name_P:*--=%=%%
echo %_name_p%
pause


Report •
Related Solutions


Ask Question