2

My system PATH variable contains "C:\myfiles" and I have a file "C:\myfiles\abc.txt".

Now I want to open it by notepad via command prompt using just "notepad abc.txt"

I expect it to open "C:\myfiles\abc.txt" (just like Bash), but it opens a file from my home directory.

How to make command prompt to search for files in PATH variables first?

rnbguy
  • 1,369
  • 1
  • 10
  • 28
  • Unlike UNIX-based shells, the Windows command prompt passes the command line untouched to the new process, assuming of course that it contains no special characters. There is no globbing or other manipulation of arguments done, so there's no way for the command prompt to search for the files. (One advantage of this approach is that you don't have to worry about a string argument accidentally being interpreted as a file argument and mangled.) There are various third-party Bash shells available for Windows. – Harry Johnston Jul 18 '16 at 22:29

1 Answers1

0

in a computer property>>advanced system setting >> system property >> envirmental veriables>> then select system variables path>> click on edit system variables path >> add new<C:\myfiles> or edit append in last <;C:\myfiles> now just type in run box or cmd prompt>> abc.txt

Pradeep
  • 317
  • 4
  • 9