1

Here's my script which basically creates a file and converts it to a sparse file

SparseFileCreator.bat

@echo off
echo ************************
echo * SPARSE FILE CREATION *
echo ************************
set /p path=Enter the Path :
set /p fname=Enter the Filename :
set /p fsize=Enter the filesize (in Mb) :
set /a sizeinbytes=fsize*1024*1024
fsutil file createnew %path%\%fname% %sizeinbytes%
fsutil sparse setflag %path%\%fname% 
fsutil sparse setflag %path%\%fname% 0 %sizeinbytes%
pause

When I run this Batch Script I get the following error, but I'm able to launch fsutil.exe from other cmd windows except the one which I used to run the batch script. Any Ideas why this is happening?

enter image description here

1 Answers1

3

You are overwritting the %path% environment variable, used to locate executable files. Change the variable name.

MC ND
  • 1,541