1.

Solve : help with Batch file which just stops??

Answer»

Hi All thanks with all the help so far !

I do have a problem at the min tho....

I am running a program which encrypts an swf file
(which i finally got working with some help)

However a new problem has occurred ..... as soon as the file is encrypted the batch file just stops and doesnot continue onto other tasks?

I was wandering if this is due to needing to wait for the encrypt program to finish, however any tasks i put after the encrypt are not called so how would you guys recommend i get round this issue?maybe you should post your code but to wait for program use Code: [SELECT]start /waitGOTO MAIN

:MAIN
CLS
COLOR 07
SET /P GAMENAME= [STRING]

IF EXIST "C:\Documents and Settings\tester\Desktop\mainDirectory\%GAMENAME%_main.swf" GOTO ENCRYPT
GOTO FILE ERROR

:ENCRYPT
COLOR 06

attrib -R "C:\Documents and Settings\tester\Desktop\mainDirectory\%GAMENAME%_main.swf"
echo Read only attribute removed for %GAMENAME%_main.swf

CD "C:\Program Files\SWF Encrypt 4.0\"
SWFEncrypt.exe -overwrite "C:\Documents and Settings\tester\Desktop\mainDirectory\%GAMENAME%_main.swf"

ECHO FILE ENCRYPTED!
GOTO END


:FILE ERROR
ECHO COULD NOT FIND FILE !
GOTO END

:END

As i mentioned I had some help to get to this stage but what I am thinking is....as the ENCRYPTING is taking place would the batch file continue?
If so it may explain why when it gets to here:

SWFEncrypt.exe -overwrite "C:\Documents and Settings\tester\Desktop\mainDirectory\%GAMENAME%_main.swf"

it executes this line a freezes?Quote from: cmd_noob on March 19, 2009, 05:43:21 AM

I was wandering if this is due to needing to wait for the encrypt program to finish, however any tasks i put after the encrypt are not called so how would you guys recommend i get round this issue?

hello cmd_noob, any message box being shown by SWFencrypt?
press CTRL+ALT+DEL, and check if the program is still responding?

there is version 5 available here: http://www.amayeta.com/software/swfencrypt/Thanks i checked the task manager and it seems the thread for swf encrypt is still running when i open another cmd and kill it, the batch file continues and does what is supposed to do.

The only problem is that i cannot put a Taskkill after the swf encrypt as the task willnot run ??

Strange

oh and i am running 4.0strange.....

when you run this swfencrypt with the COMMAND line switch -overwrite, does the application run as a windows program or console application??

you should look into why this swfencrypt doesn't QUIT after it has finish encrypting the swf file. and does it actually finish encrypting the file? try to delete this file manually before encrypting "C:\Documents and Settings\tester\Desktop\mainDirectory\%GAMENAME%_main.swf".

EXAMPLE of Executing Windows Program:
c:\MsPaint.exe - this statement will return as soon as the MsPaint Form is loaded
c:\start/wait MsPaint.exe - this statement will only return when you Close/Exit the application
c:\start %comspec% /c mspaint.exe - this statement will run mspaint.exe in a new window cmd.

so if this swfencrypt is executed as windows program, it should be returning once the form is loaded.Hey Reno

I am running it like swfencrypt.exe"C:\documents and...."

and it seems to run in a console state.
I have tried everything, it's crazy. It does however work if i manualy start up the program and then find the swf file. Thanks Reno
Seems like there is a problem with swf encrypt as it works but hangs for like 10 mins before killing the process



Discussion

No Comment Found