Sign in to follow this  
Followers 0
iceberg

File Copy LPT1

17 posts in this topic

Will this work? If not, why?

Pls help.

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

or

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

thanks.


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

Share this post


Link to post
Share on other sites



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


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

you meant you want to print it??

or do you want to put ur file IN the printer memory?


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites

you got to "net use" it first if its an printer in the network


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

hi guys,

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

thanks.


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

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

maybe

_FilePrint($file)

8)


NEWHeader1.png

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

hi guys,

any updates on this? pls assist.

thanks.


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

Share this post


Link to post
Share on other sites

hi again guys,

any solution for this now with the new beta version?


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

Share this post


Link to post
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
Sign in to follow this  
Followers 0