PC Review


Reply
Thread Tools Rate Thread

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

 
 
Matt Solob
Guest
Posts: n/a
 
      24th May 2008
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

 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      24th May 2008

"Matt Solob" <(E-Mail Removed)> wrote in message
news:4837bf42$0$6558$(E-Mail Removed)...
> 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
>


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.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A script/batch to kill a batch file from scheduled tasks? Bogdan Windows XP Configuration 1 31st Jul 2009 06:05 AM
NT Command Script switches HelpDeskNathan Windows XP Help 1 9th Jul 2008 09:57 PM
How to cmd.exe switches (/U or /A) from INSIDE a DOS batch script? Matt Solob Windows XP Help 1 24th May 2008 10:11 AM
Batch file not passing switches =?Utf-8?B?UmljaA==?= Windows XP General 1 29th Jun 2006 02:37 PM
Looking for Excel command line switches to create DOS batch files regisma Microsoft Excel Misc 4 18th Dec 2003 10:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:45 PM.