Next code prints attributes of each file in current directory because of wildcard processing.
c:\work>attrib *
I need to disable wildcard processing in my script. Escape symbols dont work:
c:\work>attrib "*"
c:\work>attrib ^*
Both give you the same.
I need to disable wildcard processing to start my application that accept wildcard as an argument.
A.java
import java.util.Arrays;
public class A {
public static void main(String[] args) {
System.out.println(Arrays.deepToString(args));
}
}
CMD
C:\work\temp>start.bat
C:\work\temp>java -cp playground.jar A *
[activation.jar, file.txt, playground.jar, playground.jar.bak, start.bat, test.bat]
C:\work\temp>start.bat
C:\work\temp>java -cp playground.jar A "*"
[activation.jar, file.txt, playground.jar, playground.jar.bak, start.bat, test.bat]
C:\work\temp>start.bat
C:\work\temp>java -cp playground.jar A "* foo? *bar*"
[* foo? *bar*]
Found workaround. "*;" - not falid folder name, but valid classpath:
java -cp "*;" A
Thanks.