Computing.Net > Forums > Programming > A couple of batch file questions

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.

A couple of batch file questions

Reply to Message Icon

Name: MikeSwim07
Date: February 1, 2009 at 07:41:51 Pacific
OS: Microsoft Windows XP Home Edition
CPU/Ram: 2.394 GHz / 509 MB
Product: Dell / DIMENSION 3000
Subcategory: Batch
Comment:

I have 2 questions

1) How can I make bold lines in cmd. Like have a title and a bold outline surrounding it. I once heard that you need to use like unicode or something in the batch file.

2) How can I do this:

Lets say I move the file C:\Windows\Test.txt to C:\backup

How can I make a batch file that I can restore the test.txt in C:\backup back to C:\Windows?

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: February 1, 2009 at 08:41:00 Pacific
Reply:

Let's start from your second question that looks quite strange to me

To move the Test.txt file from C:\Windows to C:\backup you have to code

move C:\Windows\Test.txt C:\backup

and the same to bring that back (reverting the operands)

move C:\backup\Test.txt C:\Windows

Now about the first question keep in mind batch scripts are aimed to manipulate plain text files and usually they create text as you can see in Notepad, i.e. not formatted. You can insert sequences to format text according to editors like HTML or MS Word, but this is a huge work.

You have to draw box around titles using ECHO command

echo.+-------------------+
echo.l--THIS IS A TITLE--l
echo.+-------------------+

Two hints: type /? after a command to get a quick help, e.g. MOVE /? and avoid to use in your experiments folder like C:\Windows; make a TEST directory and operate there (MD \TEST).

0

Response Number 2
Name: MikeSwim07
Date: February 1, 2009 at 09:00:05 Pacific
Reply:

1) That doesn't make a solid line. I remember someone using unicode characters like "ยบ"

2. That's not what I mean. Lets say I use a batch file to move a ton of files into a backup folder. Then I notice something goes wrong (after closing the batch file) and I need to restore the files. How would I do that?


0

Response Number 3
Name: IVO
Date: February 1, 2009 at 09:12:04 Pacific
Reply:

About solid lines, I have no exposure to unicode, but I repeat: batch files are set up in Notepad and mostly display in NT system console (people name "DOS prompt") where plain text is the rule.

To undo a moving of files you performed only you know how to revert the process by coding sequence: there is no magic procedure in Windows; System Restore works for system files only not user's data.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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: A couple of batch file questions

Batch file to find ip and host name, and save www.computing.net/answers/programming/batch-file-to-find-ip-and-host-name-and-save/19455.html

Recommendations for a Book on Batch Files www.computing.net/answers/programming/recommendations-for-a-book-on-batch-files/19543.html

Batch file, read data in email, open browser www.computing.net/answers/programming/batch-file-read-data-in-email-open-browser/19721.html