Abyssmedia.com Forum Index Abyssmedia.com
Abyssmedia Support Forums
 
  FAQ    Search    Memberlist    Usergroups   Register 
  Profile    Log in to check your private messages    Log in 

CALL problem

 
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler
View previous topic :: View next topic  
Author Message
NDog



Joined: 06 Oct 2006
Posts: 4

PostPosted: Thu Mar 15, 2007 9:26 pm    Post subject: CALL problem Reply with quote

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 Rolling Eyes
Back to top
support
Site Admin


Joined: 13 Feb 2004
Posts: 376

PostPosted: Mon Mar 19, 2007 9:01 pm    Post subject: Reply with quote

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

PostPosted: Tue Apr 24, 2007 10:19 pm    Post subject: Reply with quote

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

PostPosted: Fri Apr 27, 2007 1:13 pm    Post subject: Reply with quote

Okay overkill, very funny Laughing

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
Display posts from previous:   
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2011 phpBB Group