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:

Easton Typhoon IIIYouth Stealth Core Batting GlovesAdult
Easton Typhoon IIIYouth Stealth Core Batting GlovesAdult
$20.00
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White
$21.90
Easton TurboSlot II YOUTH Kids Baseball Batting Gloves Pair NEW
Easton TurboSlot II YOUTH Kids Baseball Batting Gloves Pair NEW
$17.99
Nike Diamond Elite Edge II YOUTH Batting Gloves Style GB0337 209 MSRP 25
Nike Diamond Elite Edge II YOUTH Batting Gloves Style GB0337 209 MSRP 25
$17.99
Franklin Neo Classic II Adult Baseball Batting Gloves 20960 Adult M
Franklin Neo Classic II Adult Baseball Batting Gloves 20960 Adult M
$35.00
Easton Typhoon II 2 ADULT Mens Baseball Batting Gloves Pair NEW
Easton Typhoon II 2 ADULT Mens Baseball Batting Gloves Pair NEW
$11.99
Easton Typhoon II 2 YOUTH Kids Baseball Batting Gloves Pair NEW White
Easton Typhoon II 2 YOUTH Kids Baseball Batting Gloves Pair NEW White
$9.99
Franklin Sports Batting Gloves MLB Adult Neo Classic II Series Batting Glove New
Franklin Sports Batting Gloves MLB Adult Neo Classic II Series Batting Glove New
$24.82
NEW Franklin Natural II Mens Batting Gloves Baseball Size Small 10393
NEW Franklin Natural II Mens Batting Gloves Baseball Size Small 10393
$34.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
$24.68
Franklin Sports MLB Adult Neo Classic II Series Batting Gloves Red Large
Franklin Sports MLB Adult Neo Classic II Series Batting Gloves Red Large
$39.18
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Large New
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Large New
$32.59
EASTON Synergy II Baseball Batting Gloves Blue Black Yellow Adult XS New
EASTON Synergy II Baseball Batting Gloves Blue Black Yellow Adult XS New
$10.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
Womens Softball Easton Synergy II Fastpitch Pink Black Purple Batting Gloves NEW
Womens Softball Easton Synergy II Fastpitch Pink Black Purple Batting Gloves NEW
$24.99
mlb adult neo classic ii series batting glove white x large
mlb adult neo classic ii series batting glove white x large
$26.41
Miken Team II Batting Glove White Small
Miken Team II Batting Glove White Small
$19.95
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
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
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
Under Armour The Yard II Batting Gloves Adult Small
Under Armour The Yard II Batting Gloves Adult Small
$17.50
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
$23.30
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


Recently Purchased Ii Batting:


easton synergy ii baseball batting gloves blueblackyellow adult xs new, new nike gb0332 diamond elite edge ii batting gloves adult pewter black leather, franklin sports batting gloves mlb adult neo classic ii series batting glove new, easton girls synergy ii batting gloves size m dk32o, under armour the yard ii batting gloves youth small, mlb adult neo classic ii series batting glove white xxlarge, easton synergy ii fast pitch adult small s batting gloves pink and white , easton rampage black amp; pink batting gloves youth small vrs ii nwt girls woman, franklin sports mlb adult neo classic ii series batting glove white medium, mlb adult neo classic ii series batting glove white small, mlb adult neo classic ii series batting glove white xlarge, franklin sports mlb adult neo classic ii series batting glove white xlarge, franklin insanity ii womens batting gloves large blackpinkoptic yellow, miken team ii batting gloves pair whitered small teambg6s, under armour the yard ii batting gloves adult small, easton synergy ii fastpitch batting gloves purplepinkblack adult small new, miken team ii batting glove white small, franklin sports mlb adult neo classic ii series batting glove white, franklin sports mlb adult neo classic ii series batting glove white xlarge, franklin sports mlb adult neo classic ii series batting glove white xlarge, new franklin natural ii mens batting gloves baseball size small 10393, easton synergy ii fastpitch batting gloves purplepinkblack adult womens sz m, easton whiteblack typhoon ii youth batting gloves pair, franklin sports mlb adult natural ii batting glove pair large blackblack new, 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, franklin sports mlb adult neo classic ii series batting glove white large new, 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 turboslot ii youth kids baseball batting gloves pair new, easton synergy ii girls youth fastpitch batting gloves, easton synergy ii fastpitch softball batting gloves youth girls size small new



Comments are closed.