EmuNewz Network

Full Version: JPCSP start batch won't run like administrator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
JPCSP script x64/x86 does not locate JPCSP.JAR if i try to run it like administrator: Right click -> Run as administrator. JPCSP launcher does not have this issue; it can start Java with administrator privileges.

I guess it happen because the CMD is starting from C:\Windows\System32\CMD.exe instead the JPCSP extract folder; however, when it is execute normally the start patch is the same: "C:\Windows\System32\CMD.exe".
x64
[attachment=10082]
x86
[attachment=10083]
could you try adding this to the bat file and see if it fixes it
add under @echo off
for /f %%I IN ("%0") do cd %%~dpI

(what this should do is extract the path of the running bat file then change the directory back to the working jpcsp directory.)
Yeah it works, thanks. I was trying first to add %~dp0 at the beginning of lib\ and bin\ but it keep looking for the rest of the files on System32. With the FOR command it look for all the files on main folder.

gid, maybe you want to add that command on the next builds.

Also, on the :END ticket should be added a PAUSE command because some times it gave some error about some allegrex thing; with the PAUSE everybody should be able to save the error about this.
(10-14-2012, 05:29 AM)hyakki Wrote: [ -> ]could you try adding this to the bat file and see if it fixes it
add under @echo off
for /f %%I IN ("%0") do cd %%~dpI

(what this should do is extract the path of the running bat file then change the directory back to the working jpcsp directory.)
It doesn't work for me when the path is containing a directory with a space in its name, e.g. "C:\Users\XXXX YYYY\Desktop\jpcsp-windows-x86"
maybe try adding quotes around cd "%%~dpI"
(10-14-2012, 05:59 AM)gid15 Wrote: [ -> ]It doesn't work for me when the path is containing a directory with a space in its name, e.g. "C:\Users\XXXX YYYY\Desktop\jpcsp-windows-x86"
You try quoting the patch? ""

EDIT: No, don't work even quoted.
hmm I actually cant re-produce the administrator issue on my pc..(probly because I use an administrator account all the time)
can you try
under echo off
cd /D "%~dp0"

--
I just did a simple test like
cd /D C:\
cd
cd /D "%~dp0"
cd

and it seemed to change back even with spaces (I added /D so it changes drives if needed)

Edit:
Added quotes, always better to have them Smile
Yeah, that one works even with spaces on the patch.

Also, some quotes on "%~dp0" aren't necessary? I tried on patch with spaces and without and works with no quotes.
Now added in r2772 Smile
Thanks!