Hack Forums
[Python] how can u run exe hidden using python - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] how can u run exe hidden using python (/showthread.php?tid=5726475)



how can u run exe hidden using python - kirubel - Sep 28, 2017

Hey I wrote a python script and wanted to run it hidden from the user how can I possibly do that please share some ideas


* - Goodies - Sep 28, 2017

You can compile it with PyInstaller using something like this:
python -m pyinstaller your_script.py --onefile --noconsole


* - F.A.S.T - Sep 28, 2017

(Sep 28, 2017 09:44 AM)Goodies Wrote:  You can compile it with PyInstaller using something like this:
python -m pyinstaller your_script.py --onefile --noconsole

Or py instead of python.

Try the one that works for you.
If you don't have it download it from here ; http://www.pyinstaller.org/downloads.html


RE: how can u run exe hidden using python - riachutrainer - Oct 30, 2017

Switching the extension from .py to .pyw will work as well if you don't want to make it executable with pyinstaller.


RE: how can u run exe hidden using python - Da7a - Oct 30, 2017

If you run the script via console, use pythonw.exe.

If you want it to be universally hidden, change the extension as riachutrainer said above.


RE: how can u run exe hidden using python - inv3ctus - Oct 31, 2017

I always tend to go for this:

Code
pyinstaller my_script.py -w -F



RE: how can u run exe hidden using python - adnankatman - Nov 1, 2017

You could also open it using popen(), this way you get the output of whatever you're running.

Code
#!/usr/bin/env python
import os
location = "C:\\file.exe"
output = os.popen(location).read()

Good luck