Hi,
I have 100s of Zip files containg DWG files with attached raster image.
I am trying to embed the raster file and make an xref free DWG file.
Hence I have created a batch file to;
--Unzip zip file (DWG & Image)
--Open DWG file using AutoCAD Raster
--EMBED image file
--Create PDF and quit.
Everything works fine except when there is no Xref(image) found in the file.
So when I manually close the stuck DWG file, batch continues with the next file.
Is there a way to check xref before it try to embed, and quit when there is no Xref ?
Or if you have any better way to do this....

Thanks in advance

Batch file:
!!! Batch to unzip files, embed raster file in dwg, Create PDF file and move dwg to a new location.
set ws=CreateObject("WScript.Shell")
set p=C:\Program Files\7-Zip\7z.exe
set wd=C:\Test\
set bd=C:\Test\output\
ws.Run "TASKKILL.exe /F /IM iexplore.exe"
"%p%" e -bd -w%wd% -y -r *.zip -o%bd%
FOR %%f in ("C:\Test\Output\*.dwg") do start /wait C:\"Program Files\Autodesk\AutoCAD 2016"\acad.exe /p "PCLI_PIPING_RD" "%%f" /b "C:\test\embed.scr"
Move /Y C:\Test\Output\*.dwg C:\Test\Embeded > C:\Test\results.txt
start cmd /c "taskkill /f /im acrord32.exe"
TIMEOUT /T 3
Move /Y C:\Test\Output\*.pdf C:\Test\Embeded >> C:\Test\results.txt
msg * "Done!"
start C:\Test\results.txt

Script file:
PROXYNOTICE
0
Purge
All
Audit
Y
iembed
zoom
extent
qsave
_PLOT
_Y
Model
DWG To PDF.pc3
ANSI B (11.00 x 17.00 Inches)
_Inches
_Landscape
_No
_Extents
_Fit
_Center the plot
_Y
monochrome.ctb
_Y
A


Y
_QUIT