5

I'm trying to recycle several of my application pool using commands in a bat file but it doesn't work.

This is my file :

%windir%\system32\inetsrv\appcmd recycle apppool /apppool.name:AppPool1
%windir%\system32\inetsrv\appcmd recycle apppool /apppool.name:AppPool2
%windir%\system32\inetsrv\appcmd recycle apppool /apppool.name:AppPool3
%windir%\system32\inetsrv\appcmd recycle apppool /apppool.name:AppPool4

This is the response in cmd :

Failed to process input: The parameter 'recycle' must begin with a / or - (HRESULT=80070057).

I've tried to had the command start at the beginning of each line but it doesn't work either.

Thanks for your help.

  • that seems to be a very descriptive error message. did you try to follow its advice? – ths Aug 26 '14 at 21:43
  • no because when I try to execute a single line, it works ! The error is on the second "recycle" parameter. All the commands are executed at the same tiem (in a row) so it doesn't work – Pierre-Antoine DOUCHET Aug 27 '14 at 07:42
  • how did you create the batch file? is it possible that you used unix linebreaks instead of dos/windows crlf? – ths Aug 27 '14 at 12:15
  • that does not really answer the second question. try to open the file in regular notepad. – ths Aug 27 '14 at 12:30
  • In the regular notepad, I saw no linebreaks ! It's weird because I always use Notepad++ and I never saw something like. – Pierre-Antoine DOUCHET Aug 27 '14 at 12:46

2 Answers2

2

you saved your file in unix format, which uses single linefeed characters. DOS/windows needs carriage-return/linefeed pairs. check your notepad++ settings, or use regular notepad to edit the file.

edit: see here for Notepad++ line endings setting: http://techtips-it.blogspot.co.at/2011/04/can-i-convert-file-format-in-notepad.html

ths
  • 2,858
  • 1
  • 16
  • 21
1

A bit late to the party, but if any one else encounters this, try running as administrator.

ShrapNull
  • 1,090
  • 1
  • 9
  • 15