Computing.Net > Forums > Programming > Help coding a batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Help coding a batch file

Reply to Message Icon

Name: CompRex
Date: October 16, 2008 at 11:43:31 Pacific
OS: Windows XP
CPU/Ram: N/A
Product: N/A
Comment:

I have been working with this assignment for afew hours
and I am having trouble getting it to work right..... I am fairly new at cmd. Help would get greatly appreciated!
Might be able to paypal some cash if motivation needed!
hah..
The assignment is:

1. Write a batch file that displays the current system date
setting without prompting for a new date and save that
output as date.txt.
2. Now display the network adapter address and save that
output as mac.txt.
3. Copy the two text files to a new file named both.txt.
4. Delete the first two text files.
5. Make a directory named asg7
6. Move both.txt to asg7.
7. Change directories to asg7.
8. Delete both.txt then delete asg7 silently, without
prompting.

Thanks!!



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: October 16, 2008 at 12:52:36 Pacific
Reply:

What have you written so far?


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: CompRex
Date: October 16, 2008 at 14:14:20 Pacific
Reply:

When I said i was new i wasn't kidding...hah

@echo off
md asg7
cd asg7
echo %date%
echo %date% >> date.txt
echo %ipconfig -all%
echo %ipconfig -all% >> mac.txt
dir

Thanks!


0

Response Number 3
Name: CompRex
Date: October 16, 2008 at 15:31:03 Pacific
Reply:

I am willing to pay money for any help i can get!


0

Response Number 4
Name: Mechanix2Go
Date: October 16, 2008 at 23:39:57 Pacific
Reply:

You're off to a good start.

Try again, keeping the steps in the order called for by the assignment.


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 5
Name: Judago
Date: October 17, 2008 at 02:15:04 Pacific
Reply:

Firstly ipconfig isn't a variable, it won't work with echo or with percentage signs, %, around it which are variable markers. Redirection >> works with almost any command and echo doesn't need to be involved.

Asking for help with homework is fine, but if you grab a script and run, with no understanding on how it works your script may just impress people enough that they ask you how it works. Now there's a fun situation.....

Here's some links that may point you in the right direction:

Ipconfig - Youv'e probably already got this.....
Copy - Pay attention to plus signs.
Md - Make directories
Move - Move files.
Rd - Remove directories.

There I've pratically done it all for you, you said something about money? ;)



0

Related Posts

See More



Response Number 6
Name: CompRex
Date: October 17, 2008 at 08:41:06 Pacific
Reply:

Thanks! All this input will help out!


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Help coding a batch file

Help creating a Batch file urgent www.computing.net/answers/programming/help-creating-a-batch-file-urgent/15963.html

need help making a batch file work www.computing.net/answers/programming/need-help-making-a-batch-file-work-/14441.html

Need help with a batch file www.computing.net/answers/programming/need-help-with-a-batch-file/17269.html