Ii Batting

C program for DOS command?

hi,

pls help me out with ths prog seriously no idea

Write a program to display the following files of current directory.
i) .EXE files ii) .BAT files iii) .OBJ files iv) .BAK files.
By using system DOS command.
@jplatt : */prog dosnt run */

#include
#include
#include
Include
#include // not working
int main(int argc, char *argv[])
{
char command[40];
if argc(2)
{ printf("error, proper list of obj, bak or .exe or bat file ");
exit (1);
}
else
sprintf(command,"dir*.%s",toupper(argv[1]));
system(command);
return 0;
}

i need to go to the specific dir ex:. .EXE files .BAT files .OBJ files.BAK files and

check the content .inside the folder.

m just a newbie :P

Start with this:

#include
#include
int main()
{
system("dir *.exe");
/* Use the following during development only: */
printf("Press enter...");
getchar();
}

That shows you how to use the system() function from to issue a shell command. If you're running on Windows, the shell is CMD.EXE, sometimes called the "DOS shell". The dir command lists a directory for all names or names matching a pattern. The "*" is a wildcard that stands for any string of characters, and "*.exe" matches anything that ends with ".exe".

You can do the same thing with other file name patterns. Another answerer has shown you how to build a command line with sprintf(), for example.

Edit: That example from jplatt39 should work. If you pasted it back the way you compiled it, there's a missing space in "dir *.%s". Platt's version has a space after the *, and yours doesn't. You also have "if argc(2) ..." instead of "if (argc < 2) ...", and the usage message mistyped. Who knows what else, since the spaces you took out of the sprintf() call caused Yahoo Answers to truncate your post.

If you are going to type in an example, type it in *exactly* as shown, or copy-paste it into your source file.

Find Ii Batting On eBay Below:

Franklin Sports MLB Adult Neo Classic II Series Batting Glove White X Large
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White X Large
$50.82
Easton Fastpitch Synergy II Batting Gloves Youth Size Medium
Easton Fastpitch Synergy II Batting Gloves Youth Size Medium
$10.00
Nike GB0332 Diamond Elite Edge II Batting Gloves Adult Pewter Black Leather
Nike GB0332 Diamond Elite Edge II Batting Gloves Adult Pewter Black Leather
$9.00
Womens Softball Easton Synergy II Fastpitch Pink Black Purple Batting Gloves NEW
Womens Softball Easton Synergy II Fastpitch Pink Black Purple Batting Gloves NEW
$21.24
Easton Rampage White Batting Leather Glove Youth Small VRS II NWT
Easton Rampage White Batting Leather Glove Youth Small VRS II NWT
$24.99
Easton Rampage White Batting Leather Glove Youth Large VRS II NWT
Easton Rampage White Batting Leather Glove Youth Large VRS II NWT
$24.99
Easton White Black Typhoon II Youth Batting Gloves Pair
Easton White Black Typhoon II Youth Batting Gloves Pair
$8.95
Nike Diamond Elite Pro II 2 Batting Gloves BRAND NEW  100 AUTHENTIC
Nike Diamond Elite Pro II 2 Batting Gloves BRAND NEW 100 AUTHENTIC
$34.98
Easton Synergy II Fast Pitch Adult Small S Batting Gloves Pink and White
Easton Synergy II Fast Pitch Adult Small S Batting Gloves Pink and White
$12.33
EASTON SYNERGY II FASTPITCH BATTING GLOVES Blue Green Black Youth Large
EASTON SYNERGY II FASTPITCH BATTING GLOVES Blue Green Black Youth Large
$5.99
FRANKLIN THE NATURAL II ADULT BATTING GLOVES VARIOUS COLORS AND SIZES
FRANKLIN THE NATURAL II ADULT BATTING GLOVES VARIOUS COLORS AND SIZES
$24.95
Franklin Natural II Adult Baseball Softball Batting Gloves White S M L XL
Franklin Natural II Adult Baseball Softball Batting Gloves White S M L XL
$40.72
Franklin Natural II Adult Baseball Softball Batting Gloves Black S M L XL
Franklin Natural II Adult Baseball Softball Batting Gloves Black S M L XL
$45.12
Franklin Insanity II Womens Batting Gloves Large Black Pink Optic Yellow
Franklin Insanity II Womens Batting Gloves Large Black Pink Optic Yellow
$14.95
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White X Large
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White X Large
$35.51
Easton White Red Typhoon II Youth Batting Gloves Pair
Easton White Red Typhoon II Youth Batting Gloves Pair
$8.95
Easton Synergy II Fastpitch Batting Gloves Pink Black Adult LARGE NEW
Easton Synergy II Fastpitch Batting Gloves Pink Black Adult LARGE NEW
$9.95
Easton Synergy II Fastpitch Batting Gloves Purple Pink Black Adult Small NEW
Easton Synergy II Fastpitch Batting Gloves Purple Pink Black Adult Small NEW
$9.99
FRANKLIN NEO CLASSIC II BATTING GLOVES VARIOUS SIZES AND COLORS
FRANKLIN NEO CLASSIC II BATTING GLOVES VARIOUS SIZES AND COLORS
$27.95
EASTON SYNERGY II FASTPITCH BATTING GLOVES Blue Green Black Adult MEDIUM NWT
EASTON SYNERGY II FASTPITCH BATTING GLOVES Blue Green Black Adult MEDIUM NWT
$12.99
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White X Large
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White X Large
$36.69
Easton Rampage Black  Pink Batting Glove Youth Small VRS II NWT
Easton Rampage Black Pink Batting Glove Youth Small VRS II NWT
$24.99
Easton Synergy II Girls Youth Fastpitch Batting Gloves
Easton Synergy II Girls Youth Fastpitch Batting Gloves
$11.99
Easton Rampage Black  Pink Batting Gloves Youth Small VRS II NWT Girls Woman
Easton Rampage Black Pink Batting Gloves Youth Small VRS II NWT Girls Woman
$20.00
Franklin Classic II Adult Baseball Softball Batting Gloves S  M  L
Franklin Classic II Adult Baseball Softball Batting Gloves S M L
$32.48
Miken Team II Batting Glove White Small
Miken Team II Batting Glove White Small
$19.95
Easton Girls Synergy II Batting Gloves Size M DK32 O
Easton Girls Synergy II Batting Gloves Size M DK32 O
$7.99
Franklin Natural II Adult Baseball Softball Batting Gloves S M L XL
Franklin Natural II Adult Baseball Softball Batting Gloves S M L XL
$40.84


Recently Purchased Ii Batting:


new nike gb0332 diamond elite edge ii batting gloves adult pewter black leather, nike gb0332 diamond elite edge ii batting gloves adult pewter black leather m, under armour the yard ii batting gloves youth small, easton batting gloves rampage youth large vrs ii whiteblack padded shipfree, easton synergy ii fast pitch adult small s batting gloves pink and white , miken team ii batting glove white small, easton synergy ii fastpitch batting gloves purplepinkblack adult small new, franklin insanity ii womens batting gloves large blackpinkoptic yellow, easton synergy ii fastpitch batting gloves bluegreenblack youth large, franklin sports mlb adult neo classic ii series batting glove white xlarge, easton girls synergy ii batting gloves size m dk32o, franklin sports mlb adult neo classic ii series batting glove white xlarge, easton fastpitch synergy ii batting gloves youth size medium, easton rampage black amp; pink batting gloves youth small vrs ii nwt girls woman, easton synergy ii fastpitch batting gloves purplepinkblack adult womens sz m, easton whiteblack typhoon ii youth batting gloves pair, easton synergy ii fastpitch batting gloves bluegreenblack adult medium nwt, easton rampage white batting leather glove youth large vrs ii nwt, easton rampage white batting leather glove youth small vrs ii nwt, easton whitered typhoon ii youth batting gloves pair, franklin neo classic ii adult baseball batting gloves 20960 adult m, easton synergy ii fastpitch batting gloves pinkblack adult large new, easton typhoon ii 2 youth kids baseball batting gloves pair new white, easton synergy ii girls youth fastpitch batting gloves, franklin natural ii adult baseball softball batting gloves black s m l xl, franklin natural ii adult baseball softball batting gloves white s m l xl, nike diamond elite edge ii youth batting glovesstyle gb0337209 msrp $25, franklin neo classic ii adult baseballsoftball batting gloves 20960 s m l, franklin neo classic ii adult baseballsoftball batting gloves 10917 s m l, franklin neo classic ii adult baseballsoftball batting gloves 10910 s m l, easton rampage black amp; pink batting glove youth small vrs ii nwt, womens softball easton synergy ii fastpitch pink black purple batting gloves new, franklin insanity ii adult baseball softball batting gloves s m l xl, franklin natural ii adult baseball softball batting gloves s m l xl, franklin classic ii adult baseball softball batting gloves s m l



Comments are closed.