Escaping character in batch

Sometimes in Programming we can escape character by \. However in batch, the escape character is ^.

Example of the special characters are & (ampersand), < (less than) and > (greater than)

For example:

Escaping & would look like ^&

<html> would be ^<html^>

PS. Today I have to escape the url.


Change working directory in batch

Today I found that I need /d parameter to change directory in a batch file.

For example:

cd /d c:\java

It should look something like this during the execution:



Open a website in a browser from commandline

My attempt to open a website in command prompt or a batch file.

I found that, for Windows, I could run


In batch script, I can do:

start explorer

Ps. Actually, I don’t really have to use start 🙂

In Linux, we should be able to run


(if there is Firefox)

Java JDK 6 also supports it using Browse class: