Search found 5 matches

by jaheaga
06 Mar 2012 13:43
Forum: DOS Batch Forum
Topic: How to "RUN AS ADMINISTRATOR" from a *.bat script.
Replies: 4
Views: 10316

Re: How to "RUN AS ADMINISTRATOR" from a *.bat script.

You can do it like this @echo off mkdir "%windir%\BatchGotAdmin" if '%errorlevel%' == '0' ( rmdir "%windir%\BatchGotAdmin" & goto gotAdmin ) else ( goto UACPrompt ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" echo ...
by jaheaga
06 Oct 2011 11:53
Forum: DOS Batch Forum
Topic: how do I echo "%errorlevel%"
Replies: 4
Views: 17336

Re: how do I echo "%errorlevel%"

thank you, I could kiss you right now....... :D :D
by jaheaga
06 Oct 2011 10:55
Forum: DOS Batch Forum
Topic: how do I echo "%errorlevel%"
Replies: 4
Views: 17336

Re: how do I echo "%errorlevel%"

thankyou, but what I want is literaly print the %errorlevel% word, not the value so it can be readed correctly from the batch file I am creating. the complete line is this: if '%errorlevel%' == '0' ( thats the line I wanna put in the new batch, so I can call it later in the script the batch I'm tryi...
by jaheaga
06 Oct 2011 09:02
Forum: DOS Batch Forum
Topic: how do I echo "%errorlevel%"
Replies: 4
Views: 17336

how do I echo "%errorlevel%"

how do I echo "%errorlevel%" to a file?
example:

echo if '%errorlevel%' == '0' (>>file.bat


I tried with ^ but it doesn't work.

This would help to solve my previous question.


Thank you
by jaheaga
06 Oct 2011 08:55
Forum: DOS Batch Forum
Topic: UACPrompt Batch
Replies: 1
Views: 3812

UACPrompt Batch

here is this batch file, if I opened with double click it goes ok, but if i call it from another batch file gives me an error with the vbs script it generates, I know the problem is on the echo UAC.ShellExecute %0 line but I'm not able to fix it. I dont want to right click and run as administrator. ...