Under Linux, there is a command called which, which can find the directory where a command is located in Path and display it. Under Linux: [adam@i ase adam]$ which ls /bin/ls [adam@i ase adam]$ which rm /bin/rm There is a where.exe in the NT Resource Kit, which has the same effect, but The Resource Kit is a fee, and here we can make a batch file to do this.
Use Notepad to edit a which.bat and store it in a directory in the Wit directory or other Path variable. The contents of the batch file are as follows: @echo off Rem Check command line parameters if { %1}=={} goto :Usage for %%ii ({ {/{-) do if {%1}==%%i?} goto :Usage %%i echo. :Rem Check in the current directory to see if The file exists for %%ii (%1) do if exist %%~nx%i ( echo %%~Fi goto :EOF ) :Rem Check the file in Path for %%ii (%1) do ( if exist %%~$PATH:i ( echo %%~$PATH:i ) else ( echo Error: %1 is not in the path!!! goto :Usage ) goto :EOF :Usage echo. echo WHICH quot;filename" echo. Echo input file, return the full path of the file! Echo. Let's test our program: Microsoft Window 2000 [Versio 5.00.2195] (C) Copyright 1985-1998 Microsoft Corp. C:\\>which WHICH quot;filename" Input file, return the file The full path! C:\\>which cmd.exe C:\\WI T\\system32\\cmd.exe C:\\> OK, the test passed!
Recently, the author has asked such a question in the major IT forums, Baidu know
Recently, some netizens asked the author a technical professional question about
Everyone knows that the command prompt window of the Windows system can use the ping command to ping
Some friends on the hard disk partition and how to use Fdisk to partition and use the magician to ad
Windows Defender command line parameters explain
Windows Vista command runas.exe full resolution
Teach you to open the command line window as an administrator
Detailed use of the Fdisk command to partition and adjust the partition
Modify the command to make the Windows disk cleaning function more powerful
Command and Configuration of CONFIG.SYS File
Common system command line for third-level PCs
Recovery Console Command Input Tips
Using the command line parameters to patch the system
Win10 Mobile 10586.71 or the best version of Win10 for WP8.1 upgrade
The whole process of win xp system from the end to the end
Microsoft Windows 7 system 17 tips
Vista system setup tips: custom personalized right-click menu
Win10 RTM Candidate Build 10176 Chinese Enterprise Edition iso image download Unofficial original
Win8 system PC input method software compatibility test
Manually bind Windows 8 system ARP method
How to clean up the win10 system junk files? The garbage cleanup method introduced
Master answering questions MSN8.5 can not be installed to solve