This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
JPCSP start batch won't run like administrator
#1
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
   
x86
   
[Image: montcer.png]
Reply
#2
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.)
Reply
#3
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.
[Image: montcer.png]
Reply
#4
(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"
Always include a complete log file at INFO level in your reports. Thanks! How to post a log
Reply
#5
maybe try adding quotes around cd "%%~dpI"
Reply
#6
(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.
[Image: montcer.png]
Reply
#7
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
Reply
#8
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.
[Image: montcer.png]
Reply
#9
Now added in r2772 Smile
Always include a complete log file at INFO level in your reports. Thanks! How to post a log
Reply
#10
Thanks!
[Image: montcer.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)