Kurto2021 Posted April 27, 2011 Share Posted April 27, 2011 Okay so I can make a .bat file and then shellexecute on the batch file passing the paramaters and make it work perfectly.....but....I don't want the dependency of the batch file being there and having to update the batch file if anything changes. How an I execute this through AUTOIT only. I took out a lot of the bat file but left the meat of the issue. I want to capture LPT1 then binary copy a file on top of another file. Then send that file to LPT1. IF EXIST LPT1: NET USE LPT1: /D NET USE LPT1: \\165.181.108.151\%tmpspol% || GOTO PRTERR GOTO PRINT :PRINT copy l:\wfx32\%tmpsys%\laser\%2.hp+x:\fx\execute\DINGRID.hp c:\print.fil > nul copy c:\print.fil lpt1 > nul erase c:\print.fil > nul @echo Printing %2 If "%3" NEQ "" GOTO PRINT :End Link to comment Share on other sites More sharing options...
JScript Posted April 28, 2011 Share Posted April 28, 2011 GOTO PRTERR And the rest of the code? Where it is :PRTERR If you post your .bat whole is easier to help you... http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
hannes08 Posted April 28, 2011 Share Posted April 28, 2011 Hi Kurto2021, you can use DriveMapAdd() to map the share to LPT1. Use DriveMapGet to see whether LPT1 is already taken, DriveMapDel to delete an existing mapping. Use Run or _RunDOS to run the copy commands. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
Kurto2021 Posted April 28, 2011 Author Share Posted April 28, 2011 prterr....is just a section in the bat file that tells you the printer you chose is invalid....each printer has a number to run the app you have to pass the parameter of the printer number......that part is irrelevant to the question and I can make it work in Autoit so I took it out to avoid confusion....appears that all I did was create confusion. Link to comment Share on other sites More sharing options...
hannes08 Posted April 28, 2011 Share Posted April 28, 2011 If DriveMapGet("lpt1") <> "" Then DriveMapDel("lpt1") EndIf $rc = DriveMapAdd("lpt1","\\server\" & $share) If $rc <> 1 Then ;Any errorhandling; Msg or equal Exit 1 EndIf FileCopy(".hp file", $source) FileCopy($source, "lpt1") FileDelete($source) Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] 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