Matthew VanDerlofske Posted February 28, 2006 Share Posted February 28, 2006 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 FileDelete("C:\APChecks.txt") $file = FileOpen("c:\APChecks.txt", 1) While $answer1 > 0 FileWrite($file, "." & @CRLF) $answer1 = $answer1 - 1 WEnd FileClose($file) $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") FileDelete("C:\APChecks.txt") Exit Link to comment Share on other sites More sharing options...
Sokko Posted February 28, 2006 Share Posted February 28, 2006 Are you compiling it to "lpr.exe"? If so, the Run command will cause the program to run itself over and over again, since the program "lpr" in the current directory will take precedence over the "lpr" command. Link to comment Share on other sites More sharing options...
Matthew VanDerlofske Posted February 28, 2006 Author Share Posted February 28, 2006 So simple no wonder I was missing it. Thank you Link to comment Share on other sites More sharing options...
Sokko Posted February 28, 2006 Share Posted February 28, 2006 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. Link to comment Share on other sites More sharing options...
randallc Posted February 28, 2006 Share Posted February 28, 2006 Hi, 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 ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
w0uter Posted February 28, 2006 Share Posted February 28, 2006 by posting your code so we can look. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
randallc Posted February 28, 2006 Share Posted February 28, 2006 thanks... Hard to get a manageable snippet without the full script; I'll put in an effort! Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
randallc Posted February 28, 2006 Share Posted February 28, 2006 OK, found the reason! One "include"sent a mouse click which kept pressing in the shortcut to the exe!! Thanks for making me look harder Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now