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:

Nike GB0332 Diamond Elite Edge II Batting Gloves Adult Pewter Black Leather M
Nike GB0332 Diamond Elite Edge II Batting Gloves Adult Pewter Black Leather M
$5.00
Franklin Neo Classic II Adult Baseball Softball Batting Gloves 10910 S M L
Franklin Neo Classic II Adult Baseball Softball Batting Gloves 10910 S M L
$42.86
Franklin Neo Classic II Adult Baseball Softball Batting Gloves 10917 S M L
Franklin Neo Classic II Adult Baseball Softball Batting Gloves 10917 S M L
$47.49
Franklin Neo Classic II Adult Baseball Softball Batting Gloves 20960 S M L
Franklin Neo Classic II Adult Baseball Softball Batting Gloves 20960 S M L
$47.49
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
$49.19
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 Batting Gloves Adult Large Black
Easton Synergy II Batting Gloves Adult Large Black
$6.45
FRANKLIN THE NATURAL II ADULT BATTING GLOVES VARIOUS COLORS AND SIZES
FRANKLIN THE NATURAL II ADULT BATTING GLOVES VARIOUS COLORS AND SIZES
$24.39
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 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
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Small
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Small
$36.69
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White XX Large
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White XX Large
$31.71
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Medium
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Medium
$34.73
Franklin Insanity II Womens Batting Gloves Large Black Pink Optic Yellow
Franklin Insanity II Womens Batting Gloves Large Black Pink Optic Yellow
$14.95
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
FRANKLIN NEO CLASSIC II BATTING GLOVES VARIOUS SIZES AND COLORS
FRANKLIN NEO CLASSIC II BATTING GLOVES VARIOUS SIZES AND COLORS
$27.32
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
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Large
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Large
$41.67
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Large
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Large
$45.09
Easton Rampage Black  Pink Batting Glove Youth Small VRS II NWT
Easton Rampage Black Pink Batting Glove Youth Small VRS II NWT
$24.99
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Large
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Large
$41.36
Franklin Classic II Adult Baseball Softball Batting Gloves S  M  L
Franklin Classic II Adult Baseball Softball Batting Gloves S M L
$32.48


Recently Purchased Ii Batting:


easton synergy ii batting gloves adult large black, new nike gb0332 diamond elite edge ii batting gloves adult pewter black leather, youth large franklin youth neo classic ii batting gloves black baseball, under armour the yard ii batting gloves youth small, nike gb0332 diamond elite edge ii batting gloves adult pewter black leather m, franklin sports mlb adult neo classic ii series batting glove white large, franklin insanity ii womens batting gloves large blackpinkoptic yellow, franklin sports mlb adult neo classic ii series batting glove white medium, franklin sports mlb adult neo classic ii series batting glove white xxlarge, franklin sports mlb adult neo classic ii series batting glove white small, franklin sports mlb adult neo classic ii series batting glove white xlarge, franklin sports mlb adult neo classic ii series batting glove white xlarge, 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, 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 20, 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, 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 , nike diamond elite pro ii 2 batting gloves brand new amp; 100 authentic, franklin insanity ii womens batting glovesvarious colors, franklin insanity ii large batting glovesvarious colors, franklin neo classic ii batting gloves various sizes and colors



Comments are closed.