|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
print to file
I am trying to be able to use files that I have generated by using the print to file feature and get a printout of that file. I have been able to view the output and when I put the string in a cmd prompt, it prints just fine, but when I drag a file to the script, it does nothing.
Here is the code I have so far in my vbs file. Any help on getting it to work and maybe compacting it a little more would be greatly appreciated. Option Explicit Dim strArg, objFSO, objFile, strTxt, WSHShell Set objFSO=CreateObject("Scripting.FileSystemObject") Set WSHShell=CreateObject("WScript.Shell") strArg=GetArgs() Filename Set objFSO=Nothing WScript.Quit Function GetArgs() If WScript.Arguments.Count < 1 Then WScript.Quit GetArgs=objFSO.GetAbsolutePathName (WScript.Arguments(0)) End Function Sub Filename() Set objFile=objFSO.GetFile(strArg) strTxt="copy /b " & objFile.ShortPath & " lpt1:" End Sub WSHShell.Run strTxt Last edited by brianwhiting : December 28th, 2003 at 05:17 PM. |
|
#2
|
|||
|
|||
|
VBS is a little set of vb..It can't be used for drag & drop operation to input the parameter!!It only can run by itself or get the parameter from command line!!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > print to file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|