PC Review


Reply
Thread Tools Rate Thread

How do I pass the /U switch to the own, current cmd.exe (setup /U as default) ?

 
 
Tom Parson
Guest
Posts: n/a
 
      24th Sep 2005
I have a batch file aaa.bat which should be executed by cmd.exe and I want to pass the /U to this cmd.exe.

How do I do this?

Ok, I could open a command prompt and enter

cmd /U aaa.bat

but this is not smart. I want to pass it without opening a first,outer cmd.exe
I want to double click on the batch file and let Win2000 do the rest.

Can I pass it somehow from within the current batch file?

Second question: Can I setup the switch /U as default for the execution of ALL
batch file executions in the future?

Where do I have to enter this switch?

Tom

 
Reply With Quote
 
 
 
 
Mark V
Guest
Posts: n/a
 
      24th Sep 2005
In microsoft.public.win2000.cmdprompt.admin Tom Parson wrote:

> I have a batch file aaa.bat which should be executed by cmd.exe
> and I want to pass the /U to this cmd.exe.
>
> How do I do this?
>
> Ok, I could open a command prompt and enter
>
> cmd /U aaa.bat
>
> but this is not smart. I want to pass it without opening a
> first,outer cmd.exe I want to double click on the batch file and
> let Win2000 do the rest.


Since you are starting it via shortcut, just alter the executable
spec by placing
CMD.EXE /U /C
in front of the fully qualified path to the .CMD/.BAT file.
This is the easiest.

>
> Can I pass it somehow from within the current batch file?


Sort of. You can use re-entrance and START. Demo below.
There may be a better way...

> Second question: Can I setup the switch /U as default for the
> execution of ALL batch file executions in the future?


Possibly. But from your posts in that other group I think you can
resolve the characters problem otherwise. Relate your language
setting, Windows character set, CMD codepage...(more?).

Other post:
>>>> everything is fine. All files with their filenames are listed

correct. Some of them contain german umlaute.

But when I enter at the command line
dir >filelist.txt
and open the created file with a text editor (e.g. Notepad or others)
the german umlaute (äöü) are replaced by some unreadable characters.
>>>>


With advice given to use CMD /U which apparently works for the
problem.


> Where do I have to enter this switch?


Per Machine or Per User. Suggest per User (your account)

Locate
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
AutoRun=
(REG_SZ)

See http://www.jsiinc.com/
Tips: 2373 3241 6280 7857

= = = u-test.cmd demo cut = = = = = =
@echo off
SETLOCAL
:: U-TEST.CMD (c:\temp\u-test.cmd) (NT5x cmd)
:: Example of pseudo-re-entrance
::
IF %1!==REENTRY! GOTO :MAIN
echo/ Inside U-TEST running in CMD "/A" (default)
pause
START "" /B /W CMD.EXE /U /C c:\temp\u-test.cmd REENTRY
echo/ Returned to first instance
echo/ Leaving U=TEST
pause
EXIT

:MAIN
echo/
echo/ Now running in CMD "/U"
echo/ At :MAIN
pause
echo/ Doing stuff...
echo. EOF reached.
pause

= = = = = = = = = = = = = = = = = = = =


 
Reply With Quote
 
=?Utf-8?B?Um95Y2U=?=
Guest
Posts: n/a
 
      24th Sep 2005

@echo off
if exist %temp%\aaa.bat del /q %temp%\aaa.bat
echo @echo off >>%temp%\aaa.bat
echo echo this is a test_1 >>%temp%\aaa.bat
echo echo this is a test_2 >>%temp%\aaa.bat
echo echo this is a test_3 >>%temp%\aaa.bat
echo echo goodby >>%temp%\aaa.bat
start cmd /u | %temp%\aaa.bat



"Tom Parson" wrote:

> I have a batch file aaa.bat which should be executed by cmd.exe and I want to pass the /U to this cmd.exe.
>
> How do I do this?
>
> Ok, I could open a command prompt and enter
>
> cmd /U aaa.bat
>
> but this is not smart. I want to pass it without opening a first,outer cmd.exe
> I want to double click on the batch file and let Win2000 do the rest.
>
> Can I pass it somehow from within the current batch file?
>
> Second question: Can I setup the switch /U as default for the execution of ALL
> batch file executions in the future?
>
> Where do I have to enter this switch?
>
> Tom
>
>

 
Reply With Quote
 
Sparda
Guest
Posts: n/a
 
      25th Sep 2005
"" wrote:
> I have a batch file aaa.bat which should be executed by
> cmd.exe and I want to pass the /U to this cmd.exe.
>
> How do I do this?
>
> Ok, I could open a command prompt and enter
>
> cmd /U aaa.bat
>
> but this is not smart. I want to pass it without opening a
> first,outer cmd.exe
> I want to double click on the batch file and let Win2000 do
> the rest.
>
> Can I pass it somehow from within the current batch file?
>
> Second question: Can I setup the switch /U as default for the
> execution of ALL
> batch file executions in the future?
>
> Where do I have to enter this switch?
>
> Tom


You could write another batch file to run the batch script with the /u
switch.

--
Posted using the http://www.windowsforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.windowsforumz.com/General...ict425113.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.windowsforumz.com/eform.php?p=1423472
 
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
How can I switch the current user from the default (Admin)? Jason Microsoft Access Security 1 28th Jun 2009 03:29 AM
Why must I pass the current date in LINQ when I have a default constraint in my database? Ronald S. Cook Microsoft C# .NET 5 13th Feb 2008 03:43 PM
How do I pass the /U switch to the own, current cmd.exe (setup /U as default) ? Tom Parson Microsoft Windows 2000 2 25th Sep 2005 06:36 PM
Pass switch to Main procedure Tod Microsoft Excel Programming 1 3rd Aug 2005 11:23 PM
Switch between forms and pass data Brian C Microsoft Access Forms 6 1st May 2004 01:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:18 PM.