# Forfiles in windows XP



## WJHamel

In a Windows Server environment, we use a bat file containing a forfiles statement to run a series of updates to sql server tables. Most of our clients are using Windows 7 which works fine with the batch file. The clients who are still running windows XP are having trouble executing that batch file. The errors are vague and inconsistent, but bottom line, they are not working as they should. The bat file looks like this:
@Echo off
@CLS
@Echo *************************************************************************** ***
@Echo ***** Please do not close this window *****
@Echo ***** The Window will close by itself when the updates are completed *****
@Echo *************************************************************************** *** 
@C:\Smartcop.mct\temp\GSP_Config\Install_version_display.exe
@C:\Smartcop.mct\temp\GSP_Config\Installer.exe
Pause
@Echo Updating Mobile Forms Databases This will take a few moments....... 
@FORFILES /p C:\SmartCOP.MCT\Temp\GSP_Config /m *.sql /c "CMD /c SQLInsert.cmd @file @fname" 
@Echo Update Complete.......
For Windows xp, the / switches have been changed to "-"'s and the @fname variable has been removed as it appears to be unrecognized in xp, from what i've read. Is there any known command in XP that will serve the same function as forfiles which we could substitute out?

i've seen some indication that i could possible use the FOR command in XP. If that is the case, are there any suggestions about how i would transpose the above to use that command instead?

thanks

James


----------



## spunk.funk

Moved to programing section for better results


----------



## Squashman

Forfiles from the 2003 resource kit will work fine on XP.

A basic for loop does not have the same functionality as the forfiles command


----------

