Jump to content

File Copy LPT1


iceberg
 Share

Recommended Posts

Will this work? If not, why?

Pls help.

FileCopy("C:\old\*.*", "LPT1")

or

FileCopy("C:\old\*.*", "LPT1:")

thanks.

<{POST_SNAPBACK}>

dont u need to tell it where to put it.. ie drive

eg

FileCopy("C:\old\*.*", "C:\new\LPT1")

windows doesnt allow u to have a colon ":" in a folder name .. only semi-colon

qq

Link to comment
Share on other sites

Hi..

i think you would like to copy the files to the Printer .. because LPT1 is the Paralellport where usually the printer is. (i have done this often .. in DOS times :-) )

But nowadays often the printer isnt at the Paralellport.. and i dont know if Windows would allow copying to LPT1. I think not.

mfg Domonoky

Link to comment
Share on other sites

thanks for all the replies. well, using Win XP Pro. wanna copy some templates to the local printer's memory. i can do this via vb script. printer is connected to LPT1.

the problem is that both vbs and dos commands are restricted in the policy. I can only execute an exe file.

thanks.

mouse not found....scroll any mouse to continue.

Link to comment
Share on other sites

  • 10 months later...

hi guys,

with the latest beta version, is it possible to copy files to the printer in LPT1 now?

thanks.

What type of file are you trying to print? If it is a text file why don't you exe notepad with the file and /p parameter to print, I believe you can hide the window in the process.

I am not sure of the code since I am relatively new to AutoIt, but I'm sure you can find an example of running notepad hidden and closing it after. The only thought that comes to mind is you may not be able to use WinGetTitle() unless you use mode 2 to match notepad as a partial title.

HTH

billmez

Edit:

WINIO.DLL is the dll file that has LPT functions in it. You can always use DllCall to open LPT1 as a handle and write to it directly.

Edited by billmez
Link to comment
Share on other sites

http://www.graphisoft.com/support/archicad...rnpltfiles.html

; NOT TESTED BUT MIGHT WORK

Run(@Comspec & " /c copy /b filename.prn LPT1", "", @SW_HIDE)

If you're running WinNT/2K/XP, you should be able to copy it to a shared printer too.

Run(@Comspec & " /c copy /b filename.prn \\servername\printersharename", "", @SW_HIDE)

The forum turned the server\printersharename into a link, I didn't mean it to be a link.

You should also be able to use FileWrite ( filehandle or "filename", "line" ) and FileWriteLine ( filehandle or "filename", "line" ) too.

FileWrite ( "\\servername\printersharename", $sValueToBePrinted )

FileWrite ( "LPT1:", $sValueToBePrinted )

FileWriteLine ( "\\servername\printersharename", $sValueToBePrinted )

FileWriteLine ( "LPT1:", $sValueToBePrinted )

I haven't tested any of these functions this way, but CyberSlug's method and my first example did work, at least up thru WinNT 4.0.

Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Link to comment
Share on other sites

hi guys,

thanks for the inputs. but i wish to highlight something here. i m not trying to PRINT files...I need to COPY some files. well this is what I exactly wanna do.

i wanna copy some TXT and PJL files to a printer's flash memory. so, previously when we were using win9x, we did this using the DOS method. but now we are using winXP and DOS Command Prompt has been restricted for normal users.

as such, i need other alternative way to perform the tasks. pls help me. thank you.

mouse not found....scroll any mouse to continue.

Link to comment
Share on other sites

hi guys,

thanks for the inputs. but i wish to highlight something here. i m not trying to PRINT files...I need to COPY some files. well this is what I exactly wanna do.

i wanna copy some TXT and PJL files to a printer's flash memory. so, previously when we were using win9x, we did this using the DOS method. but now we are using winXP and DOS Command Prompt has been restricted for normal users.

as such, i need other alternative way to perform the tasks. pls help me. thank you.

You stated earlier that you had vbscript that worked. You can convert that to AutoIt. I just converted code to add a new web site to IIS from VBS to AIT, and with the beta, it is not that bad. One area to remember is if the code contains arrays that are returned from windows functions, some of them will start at the [0] index, where in AIT the [0] index is the array count.

If you can't do that, maybe if you posted the VBS code, someone here could help you with the convert or propose a way to handle it in AIT.

HTH

billmez

Link to comment
Share on other sites

You stated earlier that you had vbscript that worked. You can convert that to AutoIt. I just converted code to add a new web site to IIS from VBS to AIT, and with the beta, it is not that bad. One area to remember is if the code contains arrays that are returned from windows functions, some of them will start at the [0] index, where in AIT the [0] index is the array count.

If you can't do that, maybe if you posted the VBS code, someone here could help you with the convert or propose a way to handle it in AIT.

HTH

billmez

with xp, isn't there a default spooler service that may be able to be used to the desired end? i'll do some research and see what if i can't find something.
Link to comment
Share on other sites

Hi,

thanks for the replies. There is the vbs code which was working previously. But only in Win 98. It didn't work on Win XP.

Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "c:\test.txt", "LPT1", True

Thanks.

mouse not found....scroll any mouse to continue.

Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...

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
 Share

  • Recently Browsing   0 members

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