Stuck with a check instance

April 21, 2009 at 14:26:27
Specs: Windows XP
I have a routine that is looking at all the user profiles on a computer checking to see if certain folders exist. If so delete them. After that is done I want it to call a vbs I have written to install certain things.
My problem is that it looks at the first users profile checks then runs the vbs script, then looks at the second users profile checks then run the vbs etc....
How can I get it to wait to do the vbs until it has checked all the users profiles, which vary, then go to the vbs.
Here is what I have right now:

::remove extra folders
:cleanup
@echo off
rmdir /s /q "C:\Program Files\AutoCAD 2008"
rmdir /s /q "C:\Program Files\AutoCAD 2010"

cd /d "%AllUsersProfile%\.."
set Docs=%CD%
for /d %%a in (*.*) do call :Del %%a
goto :eof


:Del
echo Cleaning up user "%*"
rmdir /s /q "%Docs%\%*\Local Settings\Application Data\Autodesk\AutoCAD 2008"
rmdir /s /q "%Docs%\%*\Local Settings\Application Data\Autodesk\AutoCAD 2010"

::Install Package
cscript "C:\Documents and Settings\tglidewell\Desktop\Install Package.vbs"


See More: Stuck with a check instance

Report •


#1
April 22, 2009 at 03:25:37
What you want is not fully clear to me, the following rearranged code runs the VB script after the :DEL loop is ended.

@echo off 
:: Remove extra folders

rmdir /s /q "C:\Program Files\AutoCAD 2008"
rmdir /s /q "C:\Program Files\AutoCAD 2010"

cd /d "%AllUsersProfile%\.." 
set Docs=%CD%
for /d %%a in (*.*) do call :DEL %%a 

:: Install Package
cscript "C:\Documents and Settings\tglidewell\Desktop\Install Package.vbs"
goto :EOF

:DEL 
echo Cleaning up user "%*" 
rmdir /s /q "%Docs%\%*\Local Settings\Application Data\Autodesk\AutoCAD 2008"
rmdir /s /q "%Docs%\%*\Local Settings\Application Data\Autodesk\AutoCAD 2010"
goto :EOF


Report •
Related Solutions


Ask Question