| View previous topic :: View next topic |
| Author |
Message |
NDog
Joined: 06 Oct 2006 Posts: 4
|
Posted: Thu Mar 15, 2007 9:26 pm Post subject: CALL problem |
|
|
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
| Code: | @echo off
call secretkey.exe
echo %_key%
pause |
secretkey.exe
| Code: | @echo off
set _key=1234 |
Is there a way to get the values from a .exe to a .bat? Please help thanks  |
|
| Back to top |
|
 |
|
|
support Site Admin
Joined: 13 Feb 2004 Posts: 299
|
Posted: Mon Mar 19, 2007 9:01 pm Post subject: |
|
|
| Sorry, but this is impossible. This is a main difference between EXE files and scripts. |
|
| Back to top |
|
 |
overkill
Joined: 24 Apr 2007 Posts: 5
|
Posted: Tue Apr 24, 2007 10:19 pm Post subject: |
|
|
try this:
| Code: |
@echo off
secretkey.exe
echo %_key%
echo Press the any key to continue
pause > STFU
del STFU
|
|
|
| Back to top |
|
 |
NDog
Joined: 06 Oct 2006 Posts: 4
|
Posted: Fri Apr 27, 2007 1:13 pm Post subject: |
|
|
Okay overkill, very funny
Anyway I have a way of doing this, but it requires a temp file to output the variables into a text file, then load it back into the main script. Its not 100% safe, but you can put the temp file in a secure location and delete it immediately.
xgames.bat
| Code: |
@ECHO OFF&CLS
SET LOCALKEYSHARE=C:\Keys
SET CALLKEY=call.k
SET CDKEYLOADER=steamkey.exe
CALL "%CDKEYLOADER%"
FOR /F "USEBACKQ TOKENS=1* DELIMS==" %%G IN ("%LOCALKEYSHARE%\%CALLKEY%") DO SET %%G=%%H
DEL "%LOCALKEYSHARE%\%CALLKEY%"
|
steamkey.exe
| Code: |
@ECHO OFF
IF "%GAME%"=="" EXIT
IF "%NUMBER%"=="" EXIT
SET LICENSES=3
GOTO %NUMBER% 2>nul >nul
GOTO ENDKEY
:1
SET USERKEY=hexfudmn&SET PASSKEY=bag8&SET ID=25445
GOTO ENDKEY
:2
SET USERKEY=digdoliv&SET PASSKEY=sew7&SET ID=253862
GOTO ENDKEY
:3
SET USERKEY=crjanooadiob&SET PASSKEY=wa9ef&SET ID=25386
GOTO ENDKEY
:ENDKEY
SET LICENSES>"%LOCALKEYSHARE%\%CALLKEY%"
SET USERKEY>>"%LOCALKEYSHARE%\%CALLKEY%"
SET PASSKEY>>"%LOCALKEYSHARE%\%CALLKEY%"
SET ID>>"%LOCALKEYSHARE%\%CALLKEY%"
|
FOR /F "USEBACKQ TOKENS=1* DELIMS==" %%G IN ("c:\Keys\call.k") DO SET %%G=%%H supports long file names, and it simply loads all the variables from the text file, and you can see on the next line I delete the temporary file. So its a work around. |
|
| Back to top |
|
 |
|