Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to build a batch file?

Status
Not open for further replies.

RikHess

MIS
Jul 25, 2002
69
US
We are moving from using bar codes on our event badges to using mag-cards. The vendor has provided a utility where a one line command can pass the information to the mag-card printer for each card. We only will use this for the 1-off on-location cards.

I can build the command line in my Stored Procedure, but running the command using xp_cmdshell is not working. I have set the rights for advanced options and command shell.

My next thought is to build a BAT file containing the data command, then executing that file.

Can someone help me with build this file? I feel like I'm close, but it is frustrating to not be able to get this last step to work.

If you would like more info, just ask.

Thank you.
 
RikHess said:
I can build the command line in my Stored Procedure, but running the command using xp_cmdshell is not working. I have set the rights for advanced options and command shell.

Did you try full-qualifying the path of the executable in your statement? What I mean is instead of SomeCommand.exe trying C:\VendorsSoftwarePath\SomeCommand.exe
 
This is the basic command line I built (data modified for security):
Code:
c:\windows\clientconsole "192.168.20.150" "09TexAnnMtg~2549~Lana~Green~Guest~Complex Community~ ~ ~ ~ ~ ~ ~(555)550-9126~(555)550-9128~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~EOR"

Basically it calls the vendor program "clientconsole" and provides two string parameters -- the IP address of the printer and a tilde delimited string of badge variables for the mag card.

This project is being delayed a bit as we work out the actual setup of the network we will be using for the event.

Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top