Jump to content

Program keeps rerunning

Recommended Posts

So this script runs great when using the run script option, but when I compile it to a EXE it just keeps running and never exits. Here is the code:

$Printer = "LDLAPChecks"
$Server = "PlanetPress"

$answer = InputBox("LDL Ap Checks", "How meny checks do you want to print?")
$answer1 = $answer

$file = FileOpen("c:\APChecks.txt", 1)

While $answer1 > 0
FileWrite($file, "." & @CRLF)
$answer1 = $answer1 - 1


$LprCmd = "lpr -S " & $Server & " -P " & $Printer & " C:\APChecks.txt"
Run($LprCmd, @TempDir, @SW_HIDE) 

MsgBox(4096, "AP Checks Printed", $answer & " Print Job(S) Sent Successfully")
Link to comment
Share on other sites

It's happened before, quite a few times if I remember correctly. There were a couple separated instances, I think, where people had scripts that used the "ftp" command and compiled the script to "FTP.exe", so the program duplicated itself a zillion times. All in good fun. :o

Link to comment
Share on other sites


I am cofused; I have a number of scripts which do this when compiled, but none of them , that I know , have such a run command that would do this. I have had to put "singleton" command at the begining of them; I thoght it was expected behaviour, else why would there be such a function...

I don't know still why these other scripts do that..

How can I check?

Best, Randall

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...