Posts: 456
Name: RAHUL RAJ
Location: Cochin, Kerala, India
|
When I was trying to ping via command prompt, I got an error message
"ping not recognized as internal or external command". From the Google search I found some results. Similar kind of problems occurred for 'ipconfig' also. I am sharing you the solution that I found from Google search.
- Right click on 'My Computer'. Go for properties.
- Click on 'Advanced System Settings'.
- Click on 'Advanced' and go to 'Environment variables'.
- Set both system and user path variables to C:\Windows\System32
Restart the command prompt..
We can also add linux commands like cp, ls, alias etc to windows! Just copy and paste the following codes into notepad, save it as batch file and copy them to system32 directory.
for ls :
@echo off
dir %*
for cp:
@echo off
copy %*
for man:
@echo off
help %*
for alias:
@echo off
rem bare "alias" should display all aliases
if (%1) == () goto LIST
rem "alias /?" should show the usage message
if (%1) == (/?) goto USAGE
rem capture name of alias
set tofile=%1
echo @echo off > C:\custom-path\%tofile%.bat
shift
rem build target command
set thecommand=%1
:CONTINUEBUILDING
shift
if (%1) == () goto DONEBUILDING
set thecommand=%thecommand% %1
goto CONTINUEBUILDING
DONEBUILDING
echo %thecommand% %%* >> C:\custom-path\%tofile%.bat
goto END
:USAGE
echo alias from-command to-command
echo creates C:\custom-path\from-command.bat which calls to-command
goto END
:LIST
dir /b C:\custom-path
goto END
:END
for rm:
@echo off
del %*
for cat:
@echo off
type %*
for mv:
@echo off
move %*
Last edited by rahulraj; 12-10-2010 at 12:09 PM..
|