Run a batch in the background

jojorealisateur Posted messages 214 Status Member -  
jojorealisateur Posted messages 214 Status Member -
Good evening everyone,

I created, with several friends, a batch interface that allows as many people as possible to create a Wi-Fi network hosted by a Windows PC (Wi-Fi One). To create or start the Wi‑Fi network, the user must open in administrator mode a batch file generated on the desktop containing the network name and its password...

However, I coded this interface in 2 hours and 30 minutes and now I don’t find this approach very... “pro”... So I thought it would be interesting if my main batch opened another batch on its own, in the background and in administrator mode.

My question is therefore: is it possible and if so, how? My brother mentioned “Bat to exe converter,” but I don’t know if that is very secure... We are still distributing this project on the internet and I don’t want users of our software to be infected needlessly...

Thank you in advance,

Jojorealisateur

5 answers

  1. barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention   4 930
     
    Hello,

    No known issues with Bat2Exe Converter, it is not malware.

    However, launching the second batch in the background with admin rights, I don’t know if that will work; maybe it will if the first batch is run as administrator, but I’m not sure.

    --

    “Artificial intelligence defines itself as the opposite of natural stupidity.”
    0
    1. Alvin1614 Posted messages 115 Status Member 4
       
      Good evening, it is quite possible to execute a batch file as admin thanks to Bat2Exe Converter. In addition, it also allows them to be launched in the background.

      Best regards,

      Alvin1614
      0
    2. barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention   4 930
       
      Yes, I agree with that, but it won’t be completely in the background since there will be a privilege elevation window that will appear.
      0
    3. jojorealisateur Posted messages 214 Status Member 18
       
      Yes, that’s not a problem...

      Thank you for your quick responses!

      Jojorealisateur
      0
  2. Scripteur
     
    Good evening, When launching the main batch as Admin, you can (with the cmdow utility) launch another batch silently as administrator (by default, the subprocess inherits from the parent). You can verify using SysInternals Procexp that the file is indeed launched. I’ve tested this and it works perfectly. example from a batch:
    @echo off
    cmdow /run /hid tonfichier.bat
    exit
    
    Cmdow available here (to place in the directory where the BATCH files are located): https://ritchielawrence.github.io/cmdow/ Scripteur
    0
  3. jojorealisateur Posted messages 214 Status Member 18
     
    Hello,

    I think we’re not all talking about the same Bat2Exe Converter. Indeed, when I searched for it on the Internet, I came across a multitude of programs bearing this name... The one I’m referring to is published by F2KO Software (http://www.f2ko.de/en/).

    Thank you!

    Jojorealisateur
    0
  4. jojorealisateur Posted messages 214 Status Member 18
     
    Hello everyone,

    I downloaded "Bat2Exe Converter" because it seemed safe according to the answers on this forum...

    I scanned the installer and installed files three times. According to Avira, no threats...

    So I made my batch files. I exported them and scanned them. There were no viruses... There were bugs in my programs, so I fixed all the issues. I exported them to exe format for the second time.

    When it was ready, I ran it via a batch file.

    And that's when the problem happens: Avira starts detecting a lot of viruses on my PC, including programs like "winlogon.exe" ... A Windows component!

    What should I do???

    Thanks!

    Jojorealisateur
    0
    1. t
       
      Hello,

      Could you display the result obtained by your antivirus please?

      You can however add exceptions to your antivirus:

      https://blog.avira.com/fr/ajouter-des-exceptions/
      0
    2. jojorealisateur Posted messages 214 Status Member 18
       
      Hello,

      Adding exceptions to my antivirus won’t change anything... Indeed, when I opened it, I had at least a dozen files in quarantine including files like "rundll32.dll" or "winlogon.exe"... Nevertheless, I just re-scanned the entire quarantine area and most of the system files that were declared positive are now declared healthy.

      But my exported file is still declared as "HEUR/APC"... I don’t know what it is and Avira’s Help site isn’t there to help me... " A generic recognition routine to recognize the new common family functions of the different variants. This generic recognition routine was developed to recognize unknown variants. It will be continuously perfected. " (https://www.avira.com/fr/support-threats-summary-product?tid=26757&threat=HEUR%252FAPC&track=1%29.

      Is "Bat2Exe Converter" a virus ??? Does it create viruses ??? What should I do ?

      Even if it’s a false positive - which I highly doubt - I don’t want Wi-Fi One users to see alerts signaling dangerous components in my software... Especially since Windows Smart Screen keeps detecting it as a potential danger because it’s almost entirely made up of VBS and batch...

      It’s just an interface to help people create wifi from their PC, that’s all! Dang it! Since the beginning, I’ve only received negative feedback from users who fear my software... They fear the "black screens with white text"... So, to reassure them, I’m trying to find alternatives, but I feel like I’m making things worse!

      Thank you for your precious help! I hope I’m not bothering you with my questions...

      Joachim
      0
    3. barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention   4 930
       
      Personally I am sure it is a false positive, the heuristic analyses are not very precise.

      If you want to show a clean bill of health, you can optionally sign your software; for that you need to buy a certificate: https://www.tbs-certificats.com/FAQ/fr/6.html
      0
    4. jojorealisateur Posted messages 214 Status Member 18
       
      Hello barnabe0057, Thank you for your review and for your proposal, but buying a certificate is impossible for me... Indeed, my software is under Creative Commons, my site is a Wix site and my domain is a free domain... I refuse ads on my site so that my users can browse calmly. I absolutely have no money to spend on such a thing even though I understand it gives more trust to the users of my software. I don’t sell anything, because for me, computing must remain accessible to everyone. I have tried to contact Avira several times and I have posted messages—in English, which is quite an achievement for me since I hardly speak any word of it—on their forum hoping that an Avira expert would respond to me as is the case on the Microsoft forum, but I have not received a response unlike here... Don’t you have another solution than Bat2Exe Converter? Thank you very much! Jojorealisateur
      0
    5. t
       
      Person,

      I use Batch Compiler,

      A bit slow for large scripts but it works fine:

      https://sourceforge.net/projects/batch-compiler/

      I also think those are false positives...
      0
  5. jojorealisateur Posted messages 214 Status Member 18
     
    Hello,

    So here it is, I tried "BatchCompiler"... Everything goes well until I run my script... And there, Avira scares me really a lot... Here is the Avira report (appeared as a pop-up on the left of the screen as every time) : ...
    The details button keeps taking me to this link: https://www.avira.com/fr/support-threats-summary-product?tid=3488&threat=TR%252FCrypt.XPACK.Gen&track=1.
    The details are quite alarming anyway: "The term « TR » designates a Trojan horse that is able to spy on your data, invade your privacy and make unwanted modifications to the system.

    A generic recognition routine for recognizing the new common family functions of the different variants. This generic recognition routine has been developed to recognize unknown variants. It will be continuously improved."

    Well, then, I’m OK with heuristic analyses not being precise, but someone who sees this can still be scared...

    Thanks for your responses,

    Jojorealisateur
    0
    1. jojorealisateur Posted messages 214 Status Member 18
       
      Hello,

      There’s definitely activity on my PC! Here’s what "Luke Filewalker" (Avira’s scan service) detected for me:

      What do I do?

      I’m sorry for bothering you with this question since June 10... I really need a reliable method!

      Thank you!

      Jojorealisateur
      0
    2. Scripteur
       
      Hello,

      Well, we’ll drop the software like batch compiler and do things ourselves, OK.

      I do have a solution but it’s frankly not the century’s idea...

      You would need to download the TCC-RT terminal (you’re allowed to use it, I checked):

      https://jpsoft.com/products/tcc-rt-runtime.html

      With that, you’ll be able to create an executable archive containing your script + TCC-RT thanks to this tutorial:

      https://jpsoft.com/forums/threads/btm2exe-tcc-runtime-btm-as-a-single-executable.7694/

      Your *.btm files correspond to your .bat, you can rename the extension if you want,

      If you need help or if you can’t reproduce the procedure, don’t hesitate to come back to us!

      PS: the result won’t be very ergonomic since you’ll end up with a 7MB application,

      Moreover, I recommend installing this on a 32-bit machine so that TCC-RT installs in 32-bit and not 64. Otherwise, you can only create programs in x64

      Unless you do a 32-bit extraction and then no problem on any platform

      Scripteur

      The pseudonym "t" is also "scripteur"; I got a bit confused ^^
      0
    3. jojorealisateur Posted messages 214 Status Member 18
       
      Hello t/Scripteur ;),

      I will therefore try TCC-RT... I hope it will be okay this time...

      So, if I understand correctly, we import files with the *.bat extension and the TCC-RT terminal changes them to *.exe?

      Does TCC-RT need to be installed on the users' PC of Wi-Fi One?

      Thank you!

      Jojorealisateur
      0
    4. Scripteur
       
      "Does TCC-RT need to be installed on the PCs of Wi-Fi One users?"


      No, since you distribute TCC-RT in the .exe archive containing TCC.exe and your .bat

      Let me help you if you need assistance!

      Good luck
      0
    5. jojorealisateur Posted messages 214 Status Member 18
       
      Good evening,

      Okay, thanks for your reply, but right now I have, as one might say, other problems (yes, obviously, this will never end...) :
      -The more I install TCC-RT 22, the more disk space it takes during installation. Indeed, during the first installation, the program "weighed" 5 MB. Then it took 7 MB of disk space. On the third try, it predicted 27 MB of space used... Is that normal? Also, the question you all have in mind is certainly not "Would you like to" (to quote ABBA :D https://www.youtube.com/watch?v=za05HBtGsgU ), but rather: "But why on earth does this idiot reinstall TCC-RT 22 three times???". And well, it's very simple...
      -Each time I try to launch it, the gentleman gets angry and lets me know:
      And finally, the third problem...
      -Now Avira detects -again- viruses... Certainly, I think I'm going to change antivirus...

      Well, you must be tired of this endless discussion where you try your best to help me and I tell you that it's not going well... I'm really sorry... I never thought I would get here...
      If someday I can be of use to you, don't hesitate to call on me! I will do everything in my power to help you...

      Thanks again!

      Jojorealisateur
      0