Saved Bookmarks
| 1. |
Solve : colors? |
|
Answer» Is it possible to make a like a red SQUARE with either batch or powershell?Quote from: TheWaffle on May 14, 2012, 12:04:37 PM Is it possible to make a like a red square with either batch or powershell? You mean like the red square in downtown Moscow or the red square on my plaid shirt? Back in the old days, there was a DOS driver (ANSI.SYS) that allowed you to move the cursor around the screen and produce color characters. Don't know if anything like that still exists for NT batch. Powershell would be a better choice. Code: [Select]Add-TYPE -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing $brush = new-object Drawing.SolidBrush Red $pen = new-object Drawing.Pen black $rect = new-object Drawing.Rectangle 10, 10, 180, 180 $form = New-Object Windows.Forms.Form $formGraphics = $form.createGraphics() $form.add_paint( { $formGraphics.FillRectangle($brush, $rect) $pen.color = "red" $pen.width = 5 } ) $form.ShowDialog() I found this in the snippet closet, but suspect it came from the internet. Save script with a PS1 extension and run from a Powershell prompt. You can also run from a NT prompt by preceding the script name with the interpreter name (Powershell). Enjoy. Quote from: Sidewinder on May 14, 2012, 03:48:12 PM You mean like the red square in downtown Moscow or the red square on my plaid shirt? ... or the red square in the Martin Cruz Smith novel? I've been using Ansi Escape codes to change the background, foreground and text color, to make COLORED DOS menus for somewhere around 30 years. You have to first load the Ansi.sys driver and then know what escape codes to put into your text. This is just one example, of an Ansi color menu I did, for my ME Utilities, DOS, boot disk. Here's the "Menu.txt" file, for that screen. [1;33;44m CD Rom Drivers Are Loaded [41m Main Menu, Windows ME Utilities [44m 1. Fdisk (setup new hard drive) 2. Fdisk: Make New Boot Record 3. Format drive C: 3A. Format drive D: 4. Scandisk C: ( /autofix ) 5. Scandisk All Drives ( /all /autofix ) 6. Run "Scanreg /restore" (restores an older version of the Registry) 7. Delete WMIEXE.exe (this file, not needed by Windows) 8. Run HOOVER.bat (deletes 98, ME junk files) 9. REMOVE all files from "C:\_Restore\*.*" in Windows ME. Type your choice at the DOS prompt and press ENTER. This is just a text file, called by the Menu.bat, batch file when it's run. This is not MEANT to be a tutorial, which I'm not prepared to do, but just one example of what can be done. I'm sure you can find a good tutorial somewhere. Good Luck, You can also try the debug command on 32-Bit systems for a batch file.They have some interesting threads over on the Dostips.com forums about Color and Drawing Rudimentary graphics in pure batch.I personnally wanna see the Red Square from Moscow... |
|