I would like to run a print command on specified files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
niku7
Posts: 1
Joined: 01 May 2012 07:42

I would like to run a print command on specified files

#1 Post by niku7 » 01 May 2012 07:46

Hello,

I would like to run a print command on the files specified in *.txt file.

Command: "X:\path\application.exe /p"

File list in *txt file:
X:\folder1\folder2\document1.xcmd
X:\folder3\document2.xcmd
K:\folder7\document3.xcmd
ect...

I found something similar: for %%g in (*.xmcd) do "C:\path\mathcad.exe /p %%g


Thanks for the help in advance!

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: I would like to run a print command on specified files

#2 Post by Squashman » 01 May 2012 07:48

First you have to find out if the application that opens these file types has a command line switch to print the files. Since you are the only one right now who knows what the program is you are the only one who is going to be able to figure that out.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: I would like to run a print command on specified files

#3 Post by foxidrive » 01 May 2012 08:09

Squashman has a good point - you have removed any info that could help us to see what you are doing.

But to do *something* with a list in a file:

@echo off
for /f "delims=" %%a in ('type "file.txt" ') do "something" /p "%%a"

Replace "something" /p with your command and switches.

Post Reply