Giladiald
Giladiald

Reputation: 887

creating a bat file which sends to background and closes (1 file)

im trying to do something simple, i want to start Burp Suite with extra java memory, but i don't want the CMD window to stay open.

If i don't use a .bat file and simple open cmd and type start /b "" java -jar -Xmx2g burpsuite_pro_v1.6.07.jar, Burp opens, the the process is sent to background, but the CMD window stays open. i can, however, close it manually and Burp will keep working.

when i try to put the thing into a CMD window, it will not even be sent to background, Burp stays dependent on the CMD, and i cant even add exit to the file.

i tried to solve the issue by following: run bat file in background - this worked, but required me to have THREE files, i prefer a more elegant "1 file solution"

Upvotes: 0

Views: 3147

Answers (3)

Anand Varkey Philips
Anand Varkey Philips

Reputation: 2075

Just add the below line in your bat file and the java procees will run in background with no window open!

start javaw {Path of Your jar or Java file}

Upvotes: 3

Giladiald
Giladiald

Reputation: 887

Turns out the solution was simple: using javaw. the issue was with using java.exe, some attempts even closed the CMD but opened a java.exe window (blank)

modding the file to contain: start javaw -Xmx2g -jar burpsuite_pro_v1.6.07.jar solved it for me.

Upvotes: 0

gknicker
gknicker

Reputation: 5569

The following batch file commands should accomplish your purpose:

start "" /B java.exe -Xmx2g -jar burpsuite_pro_v1.6.07.jar
exit

You can probably even leave out the /B switch.

References

How can I run a program from a batch file without leaving the console open after the program start?

How to use the start command in a batch file?

Upvotes: 1

Related Questions