0
votes

I am trying to execute batch file form cmd that do below code

SchTasks /Create /S "\\192.168.22.211\c$" /U user1 /P pwd /RU user2 /RP pwd123 /SC WEEKLY /D MON /TN "MSE_UPDATE" /TR "\\it\Programs\MicrosoftSecurityEssentials\mpam-fe.exe" /ST 10:00:00

but I am getting error message that says

C:\Users\Internet\Desktop>■S '■S' is not recognized as an internal or external command, operable program or batch file.

please if someone would help me

thanks

2
How did you save the file? Make sure it's not saved as Unicode.Klitos Kyriacou
did you save it as UTF-8 with BOM?phuclv

2 Answers

2
votes

Your batch file contains spurious characters, possibly invisible Unicode ones. Clean it up by deleting everything before /Create (put the caret at the left of the first /, Shift+Home, Del) and retyping SchTasks, or by examining the file with a hex editor and removing the "strange" characters.

0
votes

I know this is old.. but.. I just had the same problem... and my first plan was to copy into notepad and then copy & paste back... baptizing the file -- I've always done that.

But I'm in notepad++ and I clicked "View all characters"... and didn't see anything extra but crlf. and the problem persisted.

Then I read about the hex here.. and I'm thinking .. damn.. there's another level ov garbage now, lol. Actually, the file was created doing a directory ... dir >filename.bat. then copying the files into excel... then back to the filename.bat...

So .. a quick idea.. convert to Ansi.. which worked!!! Yay..

Here for the next poor bloke..