Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Fax Services Command Line Utilities
Hello,

I posted this in the SBS group and was referred to this group for a possible
answer.

--
Can you tell me if there are any command line utilities installed on the
SBS2k3 (or 2003 standard) server that would allow me to submit a fax (DCX or
TIF) image to the
fax modem/ fax board?  I'm looking for a way to shell out of a DOS
application
and submit a faxable document to the shared fax program in SBS.  In another
fax program that I am using that runs under novell, I can go to a command
line and run an executable
and pass it a phone number, file name and a few other parameters and the job
will be submitted to the fax server in the same way it would if I went to
File/Print in an application.  Also, I can run another utility that will
convert certain document types to faxable images.  So, I'm trying to find
out if I can stay away from buying another fax product and just use the
shared fax in SBS2k3 and somehow find a utility or two for command line
conversion and submission.  Workstations are generally Win2K and XP Pro.

I was referred to this article, but it's a bit deep for me:

http://msdn.microsoft.com/library/d...no
l.asp

I know there is a file called FxsSend.Exe that I believe starts the wizard,
but I didn't know if it took any parameters to automatically send the image
to a designated fax number without user intervention.  Any info would be
great.  Thanks.
--

John



Report this thread to moderator Post Follow-up to this message
Old Post
jb
08-16-04 08:56 PM


Re: Fax Services Command Line Utilities
Microsoft only provides an API for the Fax Service, but here is how you can
make your own command-line utility.

Open Notepad, paste the 20 lines from the bottom of my post, and save it
somewhere on your SBS machine with sendfax.wsf as the name. (You don't have
to use this name and it doesn't have to be on the SBS machine, but play
along for now, just for the sake of discussion.) Next, open a Command Prompt
and change to the directory containing sendfax.wsf. Let's say you've got a
file named c:\temp\testfax.tif and you want to fax it to 1-508-555-1234. You
would use this command:

sendfax /filename:c:\temp\testfax.tif /faxnumber:15085551234

The parameters are named, so you could specify faxnumber before filename if
you want. This example will run on both Windows XP and Server 2003
(including SBS 2003). The difference between XP and 2003 is that XP cannot
support remote clients. In other words, you must run the script on the XP
machine where the Fax Service and faxmodem are installed. In 2003, the
Shared Fax Service allows client machines to submit fax jobs to it. If you
want to run the script on a machine other than the SBS machine, you would
specify /server:whatever as an additional parameter on the sendfax command.
Also, you need to make sure you install the Shared Fax Client (which is part
of the standard SBS client setup, but I frequently see people who refuse to
let the SBS wizards take care of things, hence they are missing the standard
client setup).

In your case, you say you've already got your documents in TIFF format,
which is great. Otherwise, you just need to make sure that the filename you
specify is "printable" by the machine you're running the script on. When I
say "printable" it means you need to be able to right-click any file of that
type, choose Print, and have it come out on your default printer with no
further intervention. For example, on a brand-new, clean install of Windows,
the doc file extension is printable because WordPad handles it, but the xls
file extension is not printable unless you install Excel or something else
which implements printing of xls files.

I have tried to simplify the Fax API to the most essential aspects of your
needs, but there are many ways you "could" get fancier than these 20 lines.
For example, there are options for handling cover pages, sending to multiple
fax numbers at once, etc. I also skipped error-handling. If you need for the
script to give you pretty error messages when you feed it a garbage
filename, or for it to detect when the Fax Service is screwed up, then you
will need more than 20 lines.


<job>
<runtime>
<description>Sends fax</description>
<named name="filename"
helpstring="Path and filename of printable file"
type="string" required="true" />
<named name="faxnumber"
helpstring="Fax number to dial"
type="string" required="true" />
<named name="server"
helpstring="Name of computer running Fax Service"
type="string" required="false" />
</runtime>
<script language="VBScript">
Set oDoc = CreateObject("FAXCOMEX.FaxDocument")
oDoc.Body = WScript.Arguments.Named("filename")
oDoc.Recipients.Add WScript.Arguments.Named("faxnumber")
oDoc.Submit WScript.Arguments.Named("server")
</script>
</job>



Report this thread to moderator Post Follow-up to this message
Old Post
Ronny Ong
08-17-04 08:55 AM


Re: Fax Services Command Line Utilities
Hey, that looks great.  I will give this a shot.  I'm doing a SBS2003
conversion tomorrow night so I'll try it out and see what happens.  I
understand what you are talking about and will install (via the wizards) the
Fax service.  Will let you know how it turns out.

Do you know if the DCX file format will work too?  I guess I'll find out
soon enough.  Many thanks again.

John

"Ronny Ong" <ronnyong@killspam-bigfoot.com> wrote in message
news:em8UduAhEHA.536@TK2MSFTNGP11.phx.gbl...
> Microsoft only provides an API for the Fax Service, but here is how you
can
> make your own command-line utility.
>
> Open Notepad, paste the 20 lines from the bottom of my post, and save it
> somewhere on your SBS machine with sendfax.wsf as the name. (You don't
have
> to use this name and it doesn't have to be on the SBS machine, but play
> along for now, just for the sake of discussion.) Next, open a Command
Prompt
> and change to the directory containing sendfax.wsf. Let's say you've got a
> file named c:\temp\testfax.tif and you want to fax it to 1-508-555-1234.
You
> would use this command:
>
> sendfax /filename:c:\temp\testfax.tif /faxnumber:15085551234
>
> The parameters are named, so you could specify faxnumber before filename
if
> you want. This example will run on both Windows XP and Server 2003
> (including SBS 2003). The difference between XP and 2003 is that XP cannot
> support remote clients. In other words, you must run the script on the XP
> machine where the Fax Service and faxmodem are installed. In 2003, the
> Shared Fax Service allows client machines to submit fax jobs to it. If you
> want to run the script on a machine other than the SBS machine, you would
> specify /server:whatever as an additional parameter on the sendfax
command.
> Also, you need to make sure you install the Shared Fax Client (which is
part
> of the standard SBS client setup, but I frequently see people who refuse
to
> let the SBS wizards take care of things, hence they are missing the
standard
> client setup).
>
> In your case, you say you've already got your documents in TIFF format,
> which is great. Otherwise, you just need to make sure that the filename
you
> specify is "printable" by the machine you're running the script on. When I
> say "printable" it means you need to be able to right-click any file of
that
> type, choose Print, and have it come out on your default printer with no
> further intervention. For example, on a brand-new, clean install of
Windows,
> the doc file extension is printable because WordPad handles it, but the
xls
> file extension is not printable unless you install Excel or something else
> which implements printing of xls files.
>
> I have tried to simplify the Fax API to the most essential aspects of your
> needs, but there are many ways you "could" get fancier than these 20
lines.
> For example, there are options for handling cover pages, sending to
multiple
> fax numbers at once, etc. I also skipped error-handling. If you need for
the
> script to give you pretty error messages when you feed it a garbage
> filename, or for it to detect when the Fax Service is screwed up, then you
> will need more than 20 lines.
>
>
> <job>
>   <runtime>
>   <description>Sends fax</description>
>     <named name="filename"
>       helpstring="Path and filename of printable file"
>       type="string" required="true" />
>     <named name="faxnumber"
>       helpstring="Fax number to dial"
>       type="string" required="true" />
>     <named name="server"
>       helpstring="Name of computer running Fax Service"
>       type="string" required="false" />
>     </runtime>
> <script language="VBScript">
> Set oDoc = CreateObject("FAXCOMEX.FaxDocument")
> oDoc.Body = WScript.Arguments.Named("filename")
> oDoc.Recipients.Add WScript.Arguments.Named("faxnumber")
> oDoc.Submit WScript.Arguments.Named("server")
> </script>
> </job>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
jb
08-18-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

MSDN archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:47 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.