1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

FORFILES substitute in Windows XP

Discussion in 'Windows XP' started by WJHamel, Nov 16, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. WJHamel

    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
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    Forfiles from the 2003 server resource kit runs just fine on XP.
     
  3. WJHamel

    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?
     
  4. Squashman

    Squashman 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.
     
  5. WJHamel

    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
     
  6. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    If it is changing / to - it is an older version. Use the mose current version and you shouldn't have that problem.

    http://winhlp.com/node/180
     
  7. WJHamel

    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?
     
  8. Rockn

    Rockn

    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.
     
  9. WJHamel

    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.
     
  10. Sponsor

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 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1027148

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice