Webmaster Forum

Sponsored Reviews   High Bandwidth Dedicated Servers   V7N Directory
Go Back   Webmaster Forum > The Webmaster Forums > Forum Lobby > Computers & Internet
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Computers & Internet For all those computer related discussions.

Reply
 
LinkBack Thread Tools Display Modes
Old 04-10-2007, 10:38 AM   #1 (permalink)
Contributing Member
 
DaHLiA's Avatar
 
Join Date: 10-25-06
Location: India
Posts: 96
iTrader: 0 / 0%
DaHLiA is liked by many
Send a message via Yahoo to DaHLiA
General DOS Batch Files Query

Hi friends,

Hope everyone is having a happy time Well, I have two queries on the DOS Batch Files.

Query 1. Consider the scenario, there is a folder ABC containg 10 text files (notepad files) having names ONE.TXT, TWO.TXT, ... TEN.TXT
I want a batch file which can get me the output as:

Quote:
The first file in ABC is ONE.TXT
The second file in ABC is TWO.TXT
The third file in ABC is THREE.TXT
...
The tenth file in ABC is TEN.TXT
I dont mind having a echo statement for writing the words The first file in ABC is, The second file in ABC is, etc Because my ultimate aim is to learn how to get the contents of a particular folder one by one via BATCH files.

Query 2. I know START command is used to trigger any program like calc, etc in Batch files. Here the program CALC.EXE does not require any parameter. Say for example I have a utility which I normally use at the command line as

MyUtility C:\TEST\SAMPLE.CGF -H125

Dont be puzzled at the extension .CFG For the time sake let me tell you it is a window file. All I am doing by the above command is trying to expand the SAMPLE.CFG window horizontally by 125 percent and nothing else. Now my query is... this MyUtility has two parameters - one is the path of the window and two - the word "-H125".

How can I implement this using Batch file? START does not seem to work for me atleast
__________________
Cheers,
DaHLiA
___________________________________
My Virtual Shelter
“Knowing is not enough; we must apply. Willing is not enough; we must do.”
DaHLiA is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 04-10-2007, 03:55 PM   #2 (permalink)
Inactive
 
StupidScript's Avatar
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 678
iTrader: 0 / 0%
Latest Blog:
None

StupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really nice
Perhaps this link will be useful to you? http://www.ericphelps.com/batch/

Start with "Sample Batch Files". Don't forget to check out "Using FOR to Process Data Lines", too.

The site also has a link to Batfiles: The DOS Batch File Programming Handbook & Tutorial, which may help.

Regarding your queries, in the first one, you'd want to (1) cd into the directory to catalog, then (2) run a FOR loop including an incrementer for the counting (a bit of a pain, but doable) and then (3) echo your phrase+incrementer+filename, perhaps piping ( > ) the output to a text file.

For the second query, unless your .CFG file is a program, it will be launched using its associated program (probably Notepad, in that case). So you would call to the .CFG file, adding notepad arguments ... one of which might be an argument for setting its window width. You showed this example in your message (assuming MyUtility is a program in your PATH environment). I only know of a couple of basic arguments/switches for notepad that deal with the file to open and how to open it, but none that affect the window instance. Maybe MyUtility can account for those types of switches?

Have fun!
StupidScript is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > The Webmaster Forums > Forum Lobby > Computers & Internet

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch Video Watermarking Cibok Web Design Lobby 13 04-18-2008 08:46 AM
Latest batch of excellent available domains clickngo Domain Name Forum 0 11-08-2007 06:20 PM
regarding batch mode crazy_dev Coding Forum 0 01-25-2007 01:21 AM
Batch optimizing problem Drat39 Graphic Design Forum 14 06-09-2004 09:46 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 01:18 PM.
© Copyright 2008 V7 Inc


Search Engine Optimization by vBSEO 3.1.0 ©2007, Crawlability, Inc.