You are not logged in.
Pages: 1
Is this possible? I have used a third party app to encrypt a .bat file to a .exe so its contents are not able to be seen.
I have a .bat file which I wish to call a .exe compilied with QFBC, but the variables in the .exe are not passed back into the .bat
Xgames.bat
@echo off
call secretkey.exe
echo %_key%
pause
secretkey.exe
@echo off
set _key=1234
Is there a way to get the values from a .exe to a .bat?
cmd, vbs, ps, bash
autoit, python, swift
Offline
I think the exe must be running in a separate context, so probably not
Try swapping it round so you call the BAT from the exe
Offline
That works with the software I use you can call a bat from a exe,
however I wish to leave the exe encrypted and the bat as a bat so it can be modified easily. The only way around this would be to have a temp file which recieves output from the exe variable then the bat has to load it from the temp file. So now I just have to figure how to get a variablename and its data into a temp file then load the variablename and data from there
cmd, vbs, ps, bash
autoit, python, swift
Offline
Just
SET somevar>somefile.txt
Of course you'll need to be sure this 'secret' info is saved to a secure location - similarly if you pass the info when calling the exe then it will be visible in the process list
Offline
Sorry I don't know how to redirect the variable back into the bat i tried this though
One more question if i wanted to store about 3 different variables in the temp file, do you know how to do that?
thanks
xgames.bat
@echo off
call secretkey.exe
set _key=1<temp.file
echo %_key%
pause
secretkey.exe
@echo off
set _key=1234
set _key>temp.file
cmd, vbs, ps, bash
autoit, python, swift
Offline
Sorry I don't know how to redirect the variable back into the bat i tried this though
One more question if i wanted to store about 3 different variables in the temp file, do you know how to do that?
thanks
Something like this /untested
xgames.bat
@echo off
call secretkey.exe
FOR /F "tokens=1,2* delims==" %%G IN (temp.file) DO @echo [[%%G %%H %%I]]
pause
secretkey.exe
@echo off
set _key1=1234
set _key2=abcd
set _key1>temp.file
set _key2>>temp.file
Offline
Pages: 1