None of the Microsoft ping programs (ping, pathping, psping) output: Enter the ping options:
If you are executing c:\windows\system32\ping.exe and the verbose output is Enter the ping options:, then someone hacked your system and replaced the executable. But I doubt this is the case.
It is more likely one of these two scenarios.
1) Another program named ping is in the path.
2) You are not showing us all the code in your batch file and think that it does affect the code you are trying to run.
Ipconfig doesn't work inside a bat file
Moderator: DosItHelp
Re: Ipconfig doesn't work inside a bat file
I tried that on several of my systems, with various Windows versions, and indeed none of them contain that string. Ex:
Code: Select all
C:\JFL\Temp>strings C:\Windows\System32\ping.exe | findstr /i please
C:\JFL\Temp>strings C:\Windows\System32\ping.exe | findstr /i options
C:\JFL\Temp>
(If you don't have the strings.exe program, it's available on Microsoft Sysinternals page: https://docs.microsoft.com/en-us/sysint ... ds/strings)
There might be a third possibility:
- It's possible to define a registry key to define a program that will be run when another one is requested. I'm not sure if this applies here, but it's worth having a look.
@Docfxit, Please check if the following key is defined on your system:
HKEY_CLASSES_ROOT\Applications\ping.exe\shell\open\command
(Which reminds me that I never implemented that check in my which.exe program, and that I really should add it too!)
Re: Ipconfig doesn't work inside a bat file
Did you try running them both from an elevated command prompt
Re: Ipconfig doesn't work inside a bat file
I recommend to move C:\Windows;C:\Windows\System32; etc (anything to do with Windows) to the front of the path.
Always keep OS path statements upfront. Lots of installers simply append to the front of the path statement, pushing your much needed OS strings down the line.
This Active Perl run in Cygwin may be getting in your way as it is another command interpreter as well as PERL itself that is usually invoked via batch. Cygwin is Windows port for linux subsystems hosting if I recall.
PATH=C:\Programs\cygwin\bin;C:\Programs\cygwin;C:\Programs\cygwin\usr\local\bin\perl\site\bin;C:\Programs\cygwin\usr\local\bin\perl\bin;
Always keep OS path statements upfront. Lots of installers simply append to the front of the path statement, pushing your much needed OS strings down the line.
This Active Perl run in Cygwin may be getting in your way as it is another command interpreter as well as PERL itself that is usually invoked via batch. Cygwin is Windows port for linux subsystems hosting if I recall.
PATH=C:\Programs\cygwin\bin;C:\Programs\cygwin;C:\Programs\cygwin\usr\local\bin\perl\site\bin;C:\Programs\cygwin\usr\local\bin\perl\bin;