I’m using a program which uses the type command to pipe contents of a file to another program like this:
type test.txt | (another program)
This command is hardcoded in my main program. The problem is that the type command has problems with forward slashes:
E:\babak\git\bin>type e:/babak/git/bin/test.txt
The syntax of the command is incorrect.
Is there a way to override the cmd internal type with a custom application named type, which supports forward slashes, so if someone calls type in cmd, the custom type application is called?
The TYPE internal command will work fine with quotes if you enclose the argument in quotes.
You can prevent use of an internal command and force use of a batch or exe if you quote the command:
You can also include path info to force use of an exe or batch
or
But if you do not have control over how the program invokes TYPE, then I don’t see how you can use any of the above techniques.
The only other option I can think of is to preprocess your path info to convert the forward slashes into backslashes. Then you need to make sure your program gets the modifed path info.