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
$38.47
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
$34.00
Franklin Sports MLB Adult Neo Classic II Series Batting Glove Whi
Franklin Sports MLB Adult Neo Classic II Series Batting Glove Whi
$35.96
Franklin Sports MLB Adult Neo Classic II Series Batting Gloves Red Large
Franklin Sports MLB Adult Neo Classic II Series Batting Gloves Red Large
$35.85
DeMarini Digi Camo II Adult Batting Gloves
DeMarini Digi Camo II Adult Batting Gloves
$29.95
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
$36.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
$7.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
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
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.76
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
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
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 Insanity II Womens Batting Gloves Large Black Pink Optic Yellow
Franklin Insanity II Womens Batting Gloves Large Black Pink Optic Yellow
$24.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 Sports MLB Adult Neo Classic II Series Batting Glove White X Large Accs
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White X Large Accs
$41.98
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Small New
Franklin Sports MLB Adult Neo Classic II Series Batting Glove White Small New
$32.19
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
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.95


Recently Purchased Ii Batting:


new nike gb0332 diamond elite edge ii batting gloves adult pewter black leather, franklin sports mlb adult neo classic ii series batting glove white xlarge, easton synergy ii baseball batting gloves blueblackyellow adult xs new, under armour the yard ii batting gloves youth small, new miken team ii batting glove white xl, mlb adult neo classic ii series batting glove white medium, mlb adult neo classic ii series batting glove white xlarge, mlb adult neo classic ii series batting glove white xxlarge, easton synergy ii fast pitch adult small s batting gloves pink and white , miken team ii batting glove white small, mlb adult neo classic ii series batting glove white small, franklin sports mlb adult neo classic ii series batting glove white xlarge, easton synergy ii fastpitch batting gloves purplepinkblack adult small new, franklin insanity ii womens batting gloves large blackpinkoptic yellow, easton girls synergy ii batting gloves size m dk32o, brand new easton synergy ii fastpitch batting glove adult small white, franklin sports mlb adult neo classic ii series batting glove white xlarge accs, franklin sports mlb adult neo classic ii series batting glove white medium, 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, franklin sports mlb adult neo classic ii series batting glove white xlarge, easton synergy ii fastpitch batting gloves purplepinkblack adult womens sz m, easton whiteblack typhoon ii youth batting gloves pair, demarini digi camo ii adult batting gloves, 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 synergy ii girls youth fastpitch batting gloves, easton synergy ii fastpitch softball batting gloves youth girls size small new, franklin natural ii adult baseball softball batting gloves black s m l xl



Comments are closed.