4

Has anyone seen this error on an XP desktop machine before?

'net' is not recognized as an internal or external command, operable program or batch file.

It's being used in a 'net start iisadmin' script

splattne
  • 28,508
  • 20
  • 98
  • 148
Hawkeye
  • 2,699
  • 9
  • 30
  • 35

3 Answers3

6

Try looking for a file called net.exe in C:\WINDOWS\system32\

If it is there then try using an explicit path to the file in your script.

E.g.:

C:\WINDOWS\system32\net.exe start iisadmin

Qwerty
  • 1,504
  • 2
  • 15
  • 24
5

Sounds like your 'path' environmental variable is getting stomped on somewhere. The fix is to do a direct call to it like has been suggested above.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
  • Why would that happen? Name collision? – KeyC0de Oct 22 '20 at 18:30
  • 1
    @Nikos A name collision would not give you the 'command not found' error message, it would give you a syntax error for invalid command-line operations. The PATH env-var has been zeroed or otherwise modified for reasons unknown. – sysadmin1138 Oct 23 '20 at 13:21
1

Yep, seen it more than once. Try using the full path and name to net.exe.

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109