Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Need Help 4 NANSI.SYS & bat file choice/errorlevel How-to


  • Please log in to reply
1 reply to this topic

#1 PieLam

PieLam

  • Members
  • 248 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Memphis, TN
  • Local time:05:49 PM

Posted 11 August 2018 - 05:25 PM

Hi all!
I have the need  for help in the basic usage of NANSI.SYS.
I hope you guys can help me or at least point me in the right direction for what I'm needing. I'm a user of win 7 these days, on another more modern PC. I only  use FreeDOS 1.2 on occasion on an older PC…
 
Anyway, I'm trying to create a menu system from batch files in FreeDOS 1.2 and wanting to change the background colors of the entire screen from within a batch file from DOS' black to blue. I at least found the correct "ESC[" sequence to do this(copy & paste to the rescue) . I even got it working, well, sort of. In the batch file, I TYPE a text file(which is of the menu's choices)  just after the ECHO ESC NANSI sequence which works OK, sort of. Instead of the entire screen being blue(what I'm desiring) though, only part of the screen is blue while to the right of the displayed file(where the menu text file ends) remains black. Of course, below the displayed file remains black as well.
 
I've studied the NANSI.SYS' documentation and I only got more confused(too technical for me). I've even searched the web (Googled) and can't find anything that would help. Some commented coding examples I think would help me a lot.
 
In the same BAT file I use the choice command to get user input. Then afterwards, I plan on having a series of "if errorlevel…" commands to test for the user's input. I'm not sure what the proper sequence/values would be for the errorlevels.
 
I hope someone can help. Thanx in advance!
 
PS
I would've known how to do this in the "old" days. I guess I've gotten lazy these days and forgotten all the little tricks of yesteryear!  : :bubbles:
 


BC AdBot (Login to Remove)

 


#2 PieLam

PieLam
  • Topic Starter

  • Members
  • 248 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Memphis, TN
  • Local time:05:49 PM

Posted 04 September 2018 - 04:47 PM

No replies in quite some time…

Not what I was hoping for. Oh well…

I just finished creating the batch file menu system that I was needing. I'm pretty sure there are other, more efficient, ways of doing all this, but alas I had to rely on what I used to know… (these days my memory is not too good, but not too bad either, it could be much better though)

 

I realized from looking around on BC that Free DOS (AKA: FD) might not be familiar to folks. In a nutshell, FD is a text based OS that is highly compatible with the old and now non-supported Micro Soft DOS (MS-DOS)(pre-Windows days).  Incidentally, NANSI. SYS is a device driver that is compatible with the ANSI.SYS driver of MS DOS. They're both used for controlling various devices of the OS. Devices like the screen, keyboard, etc…

 

In case anyone is curious, below is a sample of what I came up with

 

To clear the screen & fill it with the 116 ASCII character. The main menu calls a bat file to do this. The bat file is as follows:

 

(since this newer W7 PC is w/o a floppy drive, I don't have a way of getting files from the FreeDOS PC to my W7 PC)

 

After changing the screen color to blue(via NANSI.SYS) and then sending the ASCII char 116(only solution I knew of that would colorize the entire screen), I call another bat that locates the cursor, then writes the menu's text(line by line). A third bat file calls each menu selection based on a selected menu choice…Like I said, not the most elegant solution, but hey, it works.  :bubbles:






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users