Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have written a batch script to open drawings. The drawings have a formatted name. The following is how they can be named (x's are places for numbers)
UAxxxxxx
UAxxxxxx SH1
UAxxxxxx SH2
Uxxxxxx
Uxxxxxx SH1
Uxxxxxx SH2some times there may a -x on the end of the numbers but that doesn't mess with the script.
Now for the problem, I have a variable which I set to a image viewing program. Then I try to start that program with a picture for it to open. Well if I use the start %prog% (pic name) the picture will open up in my default image viewer, but if i remove the start it will open in what ever program i tell it. The reason I want the start is so it doesn't pause the script while the image program is open. I will paste my script and if you have more specific questions please ask. I am just perplexed as to why this is happening.
@echo off
set prog=C:\Program Files\IGC\Brava! Reader\BravaReader.exe
set dp=G:\Active
set err=does not exist or uses non-standard name
set sht=1echo Enter uaxxxxxx for UA drawings
echo Enter xxxxxx for U drawings
echo Type exit to exit program
echo.
:startset /p dw=
if %dw% == exit goto exit
set U=U
if %dw:~0,1% == u set U=%null%if exist "%dp%\%U%%dw%.TIF" (
start "%prog%" "%dp%\U%dw%.TIF"
goto end
)
if exist "%dp%\%U%%dw% SH1.TIF" (
goto sel
:return
if %sht% == 1 start "%prog%" "%dp%\%U%%dw% SH1.TIF"
if %sht% == 2 start "%prog%" "%dp%\%U%%dw% SH2.TIF"
if %sht% == 3 start "%prog%" "%dp%\%U%%dw% SH1.TIF" | start "%prog%" "%dp%\%U%%dw% SH2.TIF"
goto end
)
echo %err%:end
echo.
goto start:sel
echo 1 for sheet 1
echo 2 for sheet 2
echo 3 for both sheets
echo.
set /p sht=
goto return:exit
Also note I have tried typing the names of the program and a picture behind it in the command prompt and that opens the picture in that program. It just doesn't work with start in front of it in my script

Try:
start "" "%prog%" "%dp%\U%dw%.TIF"Start assumes that the first argument in "double quotes" should be the title of the new window. Specifying "" as the first argument gets around this. It would be nice if the help page in xp mentioned this.......

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |