익명 02:47

How to run a .bat file for a game which starts a webserver?

How to run a .bat file for a game which starts a webserver?

I'm on Ubuntu 24.04 and I have the 9.something version of Wine installed. I have a few games which require running a .bat file (since it wasn't made for Linux) in order to work. When I try to right-click -> Open with wine installer, nothing happens. Then I tried this:

~$ wine cmd.exe /c home/myself/Downloads/thegamefiles/Start—thegame.bat

I got this result:

007c:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\winebth": c0000135
Can't recognize '/home/myself/Downloads/thegamefiles/Start—thegame.bat' as 
an internal or external command, or batch script.

What is the problem and how can I get this to work?

I also tried to make a .sh copy of the file (with #!/bin/bash instead of @echo off), but the terminal tells me command not found for every line. edit: As asked I made this output on the terminal

~$ ls -l /home/myself/Downloads/thegamefiles/Start—thegame.bat

And I got this:

ls: cannot access '/home/myself/Downloads/thegamefiles/Start—thegame.bat': No such file or driectory

And I can also give the code inside the bat file :

@echo off
title title of the game
echo.
echo   ++++++++++++++++++++++++++++++++++
echo          title of the game
echo         the game
echo   ++++++++++++++++++++++++++++++++++
echo.
echo   Opening browser...
START http://127.0.0.1:29595/
echo   Starting server...
echo.
echo   Closing this window will stop the server
"server/miniweb.exe" -p 29595 -i 127.0.0.1 -r game/thegame >nul 2>&1
echo.
echo   Shutting down...
echo.

another edit: the game's folder is organised this way => there's the Start-thegame.bat file and two additional folders named "Server" (where there's just the "miniweb.exe file) and "Game" which contains another folder which in turn has a html file,and dozens of folders with pretty names such as "d5dc1e3202d89e15b3f5675fab7b1c86" with a binary file inside every single one of them.

new edit: I tried to do as told in here with this command:

wine cmd c/ /home/myself/.wine/drive_c/users/myself/Downloads/thegamefiles/Start-thegame.bat
0080:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\winebth": c0000135
Microsoft Windows 10.0.7601


Top Answer/Comment:

The miniweb.exe file is a small HTTP server. Its functionality can be replicated on Ubuntu with:

python3 -m http.server 29595

where 29595 can be replaced with any port. Then, you can go to:

localhost:29595 

or

127.0.0.1:29595

in a web browser of your choice. Again, 29595 can be replaced with any port.

The HTTP server allows the game to access other local assets, which browser security permissions would normally not allow.


For others who found this question and want to run a .bat file, you can run it using:

wine cmd /c /windows/path/to/file.bat
상단 광고의 [X] 버튼을 누르면 내용이 보입니다