Home > Back-end >  Contents within a .bat file not running properly when running said .bat file
Contents within a .bat file not running properly when running said .bat file

Time:10-02

So I've encountered a very odd problem while trying to run this java application I've just compiled. I wrote this very simple .bat file to run the program with just one parameter:

@echo off
java –Dproperties.location=%~dp0config.properties -jar userspro-ak.jar >> logs.log
pause

but when I run it, this happens: I'm really confused as to why instead of writing -D it writes those weird characters I'm not familiar with, but because of that, the program won't run!

Already ran the command in CMD writing it by hand and the application booted succesfully. Please help, does anyone please know what I can do to fix this? Is it my Windows install or something?

CodePudding user response:

The 6th character in your batch file looks like a dash. But it is not a dash. It is an em-dash, or some other dash-like character from the higher unicode plane.

Go in, fix it. Replace it with an actual dash. Open it with an editor, highlight the dash, and hit the - key on your keyboard. For good measure, do this to all the dash-like constructs in there.

  • Related