FORFILES substitute in Windows XP

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

WJHamel

Thread Starter
Joined
Sep 29, 2011
Messages
11
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?

thanks!
james
 

Squashman

Retired Trusted Advisor
Joined
Apr 4, 2003
Messages
19,786
Forfiles from the 2003 server resource kit runs just fine on XP.
 

WJHamel

Thread Starter
Joined
Sep 29, 2011
Messages
11
Thanks. So do you see anything in the above, as it was written for Windows 7, which needs to be mod'd to fire off correctly in XP?
 

Squashman

Retired Trusted Advisor
Joined
Apr 4, 2003
Messages
19,786
Well it sounds like you were using the version of Forfiles from the Windows 2000 Server Kit on your XP computers. That version has a completely different syntax and also doesn't support some of the options that the 2003 version has. I am pretty sure the version that came with 2003 should work just fine.
 

WJHamel

Thread Starter
Joined
Sep 29, 2011
Messages
11
Well, at this point, we're getting quite muddled between the different versions we likely have floating around. Do you have any idea what the version numbers are between the 2003 and the resource kit versions?

thanks again

james
 

WJHamel

Thread Starter
Joined
Sep 29, 2011
Messages
11
I was under the impression that preceding switches with a - was necessary in XP, that it was an issue with XP recognizing the - and not recognizing the / as that was used in vista and later versions of the OS. Will XP, using any of it's internal commands, allow the / before switches?
 
Joined
Jul 29, 2001
Messages
21,334
Almost all command line stuff in XP allows for /switches. Looking at the link I sent you it the version of FORFILES that converts to - was initially from the Linux/Unix world.
 

WJHamel

Thread Starter
Joined
Sep 29, 2011
Messages
11
Thanks. We figured it out. We needed to be using the 5.2 version with the / switches and had to remove the @FNAME variable.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top