-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Really want to lean how to use this but.. #27
Comments
What is the exact message? What is the exact way you try to run this? What operating system do you use? Did you explicitly run it through Python? |
Wow, thanks so much for your fast reply. No I didn't run it in python. I did it in CMD. The file I want to unpack is a .pak with this name ProjectYUKI-WindowsNoEditor.pak. My main Drive with Windows 10 on it user is called Norvid The script isn't doing what it was doing yesterday anymore. Seems to happily sit in the CMD prompt but the argument comes back and incorrect syntax. I tried to retro-fit the string you gave as help to a previous poster by changing the relevant details to my PC but it didn't work. Would love an explanation as I'm terrible with this kind of thing but love learning and appreciate all the efforts of people who are happy to share their works with the community. |
Try something like this:
I just saw: you have spaces in the file path. You need to quote file path that have spaces in them (i.e. put You could also create a file @echo off
"C:\path\to\python.exe" "C:\path\to\u4pak.py" unpack %1
set /p temp="Hit enter to continue" Make sure it really has a Since I don't use Windows I haven't tested this myself. Don't know if there is a bug in this batch script, it's written from head. I hope that helps! :) |
Cool that sounds easier. So do I just create a text file and then save the code as a .bat? |
Thanks for that. Tried it and after dragging the files on to it the CDM window came up and said hit Enter. So I did and nothing happened. Didn't notice a blip on any cpu usage. This is how I put it in the the text doc and then save as a bat. @echo off Does the space between New and folder have anything to do with it? |
Is there no message before "Hit enter to continue"? If there really is no message add |
Hm, it somehow can't find or execute python. I don't know much about Windows or how command quoting works there. Try to put python into a path that has no spaces in it (e.g. rename the folder to @echo off
C:\Users\Norvid\Desktop\New_folder_2\python.exe C:\Users\Norvid\Desktop\New_folder_2\u4pak-master\u4pak.py unpack %1
set /p temp="Hit enter to continue" Spaces in filenames are always making problems, because it wasn't really thought through how these things work. If you can have spaces in filenames, when you pass the filename to a program, how does it know its one argument with a space in it or two arguments? That's what the quotes are for, but maybe it works differently than I thought under Windows. Under Linux/macOS there is a clear way to handle spaces, but even there it still can lead to problems. |
PS: I don't know what the current working directory of a batch file executed that way is. The extracted files will be placed into that directory. It might be the directory the batch file is in, or it might be your user home directory ( |
Hey thanks so much for sticking with me on this. It's a bit of a puzzle but I think you are like me and like to solve them. I did discover something based on your last suggestion. The python.exe in folder 2 is the bloody application install exe lol. So I looked in Users\Norvid and found he actual python.exe. But....!! When I modded the bat and dragged the target on it came up with that message again. "This app cant run on your PC." One thing I noticed is that the python version is 32bit and I'm running 64. Could that have anything to do with it? I didnt notice a 64bit version when I was getting it. |
I don't know how Windows manages 32bit applications on 64bit installations. I thought 32bit applications where supported on 64bit Windows. But yes, it could be the problem. Google says you can install Python via the Microsoft Store. I have no experience with that, but I guess that would be worth looking into? |
Cheers mate I'll give it a go and report back. |
Hi again, So I managed to prevent that error by installing a 64bit version of python. However nowiit seems the script cant open it. Not sure if it's because the syntax is wrong with the python being in \Program Files\ Note the sp ace. It did put quotes around the two args as bellow but got the attached message back. @echo off I've done the code wrong haven't I? Or should I move python to a folder with no spaces? |
You have a wrong quote. It needs to be: @echo off
"C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1264.0_x64__qbz5n2kfra8p0\python.exe" C:\Users\Norvid\Desktop\New_folder_2\u4pak-master\u4pak.py unpack %1
set /p temp="Hit enter to continue" |
I think I had that originally. Let me try it again. |
Same thing unfortunately. C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1264.0_x64__qbz5n2kfra8p0\python.exe: can't open file 'C:\Users\Norvid\Desktop\New_folder_2\u4pak-master\u4pak.py': [Errno 2] No such file or directory |
Well, that sounds like that file does not exist. Where did you put |
Well then you need to write: @echo off
"C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1264.0_x64__qbz5n2kfra8p0\python.exe" C:\Users\Norvid\Desktop\New_folder_(2)\u4pak-master\u4pak.py unpack %1
set /p temp="Hit enter to continue" |
Bloody hell, of course. |
unsupported version: 5 Hmmn.. |
That means it's a file format version I don't know about and therefore can't read. Sorry. After all that hassle that's disappointing, sorry. :/ |
Not at all mate. I really appreciate you taking all that time to have a go and try to help me. It interesting too so I kind of enjoy tinkering with a very large amount of guidance from you. |
Well if you want to play with it just for fun I could easily create a megaupload if you have the bandwidth. |
No. No copyright infringement. |
Fair point. Thanks again mate for helping. :) |
I used this issue to figure out what to do and your python script works perfectly :) |
(Reading through old issues right now.) Also: I've also written a new tool now that doesn't require Python, but instead I provide a compiled Windows binary. It is faster, but has slightly different command line arguments and a feature for Windows users that don't want to use a terminal. Does that work for you? |
When I try to run the script in CMD it says your PC cant run this.
I have the latest version of Python installed. 3.7.4
The text was updated successfully, but these errors were encountered: