frs internal or external command

I have no knowledge of script and trying to run an old script on windows7 PC and got the below error, hope someone will suggest/correct it?
The error message was "for" is not recognized as internal or external  operable program or batch file.
Here is the contents of the batch file.
rem @echo off
for /f %%a in ('fsr \\%1\%2') do (if %%a LSS %3 echo %1 %2 drive has %%a MB remaining && echo.) >>"C:\support\Report.txt"
not sure what this fsr does.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fsr in this case appears to be a command-line application connecting to a server named %1 (parameter 1) and share %2 (parameter 2), and returning a the amount of free space as a number, which is then put into a variablenamed %%a.

It then compares %%a with a third parameter (%3), and if it is LESS than the third parameter (LSS = Less than) then it echoes the text to show that there is %%a remaining free, and then a new line - and then placing that text into the file C:\support\Report.txt

I can only surmise that the reason this script is not working for you is because you are not passing it 3 parameters.  Try running it like this:

Script.bat <SERVER> <SHARE> <Number>, example:

Script.bat MGMT122 C$ 1024

Open in new window

Of course, replace Script.bat with the actual filename.  Your script depends on fsr.exe being available in the same location as it is located, or in your system path.
Bill PrewIT / Software Engineering ConsultantCommented:
The error message was "for" is not recognized as internal or external  operable program or batch file.
Are you sure the message isn't:

The error message was "fsr" is not recognized as internal or external  operable program or batch file.

If that is the actual error, then that indicates that you don't have the FSR program that the script originally used, apparently to get free space for the share specified.

Do you know what the script was supposed to do, and what parms you pass to it?  We can probably come up with an alternate to FSR if we know a little more.

sara2000Author Commented:
Sorry typo error.

The error message was "fsr" is not recognized as internal or external  operable program or batch file.

This script is supposed to get disk info, that is used space and available space, etc
It is working on windows2003 server.
Do i have to have a program to work FSR?
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Bill PrewIT / Software Engineering ConsultantCommented:
On the Windows 2003 server where the script works, try and locate the FSR program.  At a command prompt try typing:

where fsr

and see if it shows a file location.  If not you can try a full search of c:\ like this:

where /r c:\ fsr

Once you find it see if it's in a folder with other utilities, etc.  The question I'm trying to answer is where it came from.  It could be another BAT script, or an EXE, etc.

If it is an EXE, try doing either of these to see if you can get help displayed that might indicate it's origin.

fsr /?
fsr -help


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sara2000Author Commented:
frs.exe path was missing.
Bill PrewIT / Software Engineering ConsultantCommented:
Great, glad that helped.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.