0

I’m having some trouble trying to create a very simple .exe file that starts a .url file in the same directory, when I try to run it, a pop-up message shows an error telling that:

“<filename.exe> is not a valid Windows Embedded Compact application”.

Starting from the beginning…

I first created (on my windows11 PC) a “test.bat” file with this code “start webpage.url”, inside the same directory I have already the “webpage.url”.

Then I converted the “test.bat” file into a “test.exe” file with “BatToExe Converter” with the 32bit option enabled, so now I have this folder:

  • MyFolder
    • test.bat
    • test.exe
    • webpage.url

The .exe file on my win11 PC runs correctly, opening the “webpage.url” file into a web browser, but when I copy the entire folder to a Windows Embedded PC and then I try to run it, appears the pop-up error message told upon.

My question is… is there any tool capable of converting a batch file to an exe that runs on Windows Embedded Compact (XP)?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • 2
    To be clear, the tool you have mentioned, does not convert an executable file, (.bat, .cmd), to another type of executable file, (.exe). All it does is package your batch file inside a self extracting file, which upon execution, extracts the batch file in a particular, (temporary), location, runs that batch file normally, then deletes that extracted batch file. It is also very simple for an end user to intercept that file during that process, copy it, then read it. There's no real benefit in wasting time, money, or effort to do this, unless you just want to be able to give it a different icon. – Compo May 17 '23 at 20:33
  • That said, for this type of task, all you should have in `MyFolder` is `test.exe`, or at least, both `test.bat` and `webpage.url` should be packaged together in `test.exe`. When `test.exe` is run, it should extract both files to the same location, which allows you to run one relative to the other. The easiest way to do that is to change `start webpage.url` to `start "" "%~dp0webpage.url"`. Your question about creating and running a file for a Windows Embedded system however is off topic for StackOverflow, and may be better received on [Super User](https://superuser.com/questions/ask). – Compo May 17 '23 at 20:46
  • The reason why I have to convert a batch file to an exe is because I need to have a .exe file to run from a pushbutton inside my HMI application (Premium 5 from Asem brand), this application does not support basic functionality as showing a specific url inside a web view by itself. – AleDetto May 17 '23 at 20:55
  • Ok I will also try the "Super User" way – AleDetto May 17 '23 at 20:58
  • As I said though this is still just running a batch file. Please package both files together so they extract to the same temporary location, after making the change I have offered. Then if you still have problems running it on the embedded system, seek assistance on a more appropriate platform. – Compo May 17 '23 at 21:01

2 Answers2

0

Please try this one: https://github.com/dehoisted/Bat2Exe

Or maybe it helps if you run your BatToExe Converter directly on your target machine to produce your .exe file there.

arise21
  • 63
  • 4
  • I tried to run my Bat2Exe application on the WinCE PC but it also make appear the same pop-up error i get by running my .exe file. Then I tried to download the executable version of the code that you linked me by gitHub, but I didn't manage do to it, I can onli download the source code. – AleDetto May 17 '23 at 20:49
0

Try to convert the batch to an executable then convert the windows executable to a windows embedded executable. I know there are apps for batch 2 exe and there is probably an app for exe to embedded executable.