Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows VistaWindows XPWindows MeWindows 98Windows 95Virtual PCInternet ExplorerOutlook ExpressWindows MediaSecurity
Related Topics
MS Server ProductsMS OfficePC HardwareMore Topics ...

Windows Forum / Windows XP / General Topics 1 / May 2008

Tip: Looking for answers? Try searching our database.

How to cmd.exe switches (/U or /A) from INSIDE a DOS batch script?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matt Solob - 24 May 2008 08:09 GMT
Ok, I could set a cmd.exe's switches when calling a batch file by entering

cmd.exe /U mybatchfile.bat

But assume I start with the default /A (ANSI) or just by double clicking on a *.bat file.
Now (after some performed statements) I want to switch output to /U (=Unicode).

Is there a way to set/modify this /U switch from INSIDE a DOS batch script?

Matt
Pegasus (MVP) - 24 May 2008 10:11 GMT
> Ok, I could set a cmd.exe's switches when calling a batch file by entering
>
[quoted text clipped - 9 lines]
>
> Matt

You need to invoke another instance of the Command Processor,
e.g. like so:
@echo off
if /i "%1"=="Unicode" goto action
echo Primary processor
cmd.exe /u /c %0 Unicode
goto :eof

:Action
echo Secondary processor
dir c:\
{Your other batch file commands go here}

By the way, DOS is an operating system introduced some thirty
years ago. It is now considered a legacy OS and is only rarely
used. DOS did not understand switches such as /U or /A. The
example I gave above is a batch file, not a DOS batch script.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.