Try something like this (comma is not necessary, and a file name with a space needs to be enclosed in quotes).
Note that the "ProgramPath" variable in your script is not valid; there's no share
@echo off
cls
set ProgramPath="\\domain.local\convert2bmp.exe"
set ResourceFolder=\\domain.local\Resources
echo Pick a source folder
echo 1. Icons 16 Folder
echo 2. Icons 32 Folder
set /p choice=
echo Enter space separated file name list without extension ^(only accepts pngs^)
set /p FileNameList=
if '%choice%'=='1' (set Source=Icons16)
if '%choice%'=='2' (set Source=Icons32)
for %%a in (%FileNameList%) (
%ProgramPath% "%ResourceFolder%\%Source%\%%~a.png" "%ResourceFolder%\%Source%\%%~a.bmp"
)
awilderbeast
ASKER
that comes back with
Pick a source folder
1. Icons 16 Folder
2. Icons 32 Folder
2
Enter space separated file name list without extension (only accepts pngs)
newspaper_add newspaper_delete
( was unexpected at this time.
C:\Windows\system32>
oBdA
Sorry, simply a "do" missing:
@echo offclsset ProgramPath="\\domain.local\convert2bmp.exe"set ResourceFolder=\\domain.local\Resourcesecho Pick a source folderecho 1. Icons 16 Folderecho 2. Icons 32 Folderset /p choice=echo Enter space separated file name list without extension ^(only accepts pngs^)set /p FileNameList=if '%choice%'=='1' (set Source=Icons16)if '%choice%'=='2' (set Source=Icons32)for %%a in (%FileNameList%) do ( %ProgramPath% "%ResourceFolder%\%Source%\%%~a.png" "%ResourceFolder%\%Source%\%%~a.bmp" )
now i get
Pick a source folder
1. Icons 16 Folder
2. Icons 32 Folder
1
Enter space separated file name list without extension (only accepts pngs)
newspaper_add newspaper_delete
Error: Invalid parameters number.
Error: Invalid parameters number.
C:\Windows\system32>
oBdA
That's a syntax error with "convert2bmp.exe" then.
Put an ECHO in front of the "%ProgramPath% ..." line to see the commands that are created, and check which syntax requirements "convert2bmp.exe" has.
awilderbeast
ASKER
got it! found the error its working now :)
is tehre anyway i can make it pause on error?
or perhaps stop at the end, press q to quit or n to start the script again?
Note that the "ProgramPath" variable in your script is not valid; there's no share
@echo off
cls
set ProgramPath="\\domain.loca
set ResourceFolder=\\domain.lo
echo Pick a source folder
echo 1. Icons 16 Folder
echo 2. Icons 32 Folder
set /p choice=
echo Enter space separated file name list without extension ^(only accepts pngs^)
set /p FileNameList=
if '%choice%'=='1' (set Source=Icons16)
if '%choice%'=='2' (set Source=Icons32)
for %%a in (%FileNameList%) (
%ProgramPath% "%ResourceFolder%\%Source%
)