Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Ninety percent of baseball is half mental." -- Yogi Berra


devel / alt.msdos.batch / Re: I need to check if I am running as Administrator

SubjectAuthor
* I need to check if I am running as AdministratorT
`* Re: I need to check if I am running as AdministratorJJ
 `* Re: I need to check if I am running as AdministratorT
  `* Re: I need to check if I am running as AdministratorT
   `* Re: I need to check if I am running as AdministratorJJ
    `- Re: I need to check if I am running as AdministratorT

1
I need to check if I am running as Administrator

<tknbh6$142ol$4@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=281&group=alt.msdos.batch#281

  copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T...@invalid.invalid (T)
Newsgroups: alt.msdos.batch
Subject: I need to check if I am running as Administrator
Date: Fri, 11 Nov 2022 21:38:46 -0800
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <tknbh6$142ol$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 12 Nov 2022 05:38:46 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e4a96b0f517a3fa6d2eb2db7ff66bb97";
logging-data="1182485"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bmAtOjDI1limOBAUhf48Bk9HxnYarPzM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:dr+Qtp6p/l8FZgjhrIwkISIOB8Q=
Content-Language: en-US
 by: T - Sat, 12 Nov 2022 05:38 UTC

Hi All,

Is there a simple command line I can throw
to tell me if I am running as administrator?

Many thanks,
-T

Re: I need to check if I am running as Administrator

<w2m9ryulmsgj$.1clyx8i93ob0m.dlg@40tude.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=282&group=alt.msdos.batch#282

  copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4pub...@outlook.com (JJ)
Newsgroups: alt.msdos.batch
Subject: Re: I need to check if I am running as Administrator
Date: Sat, 12 Nov 2022 13:27:20 +0700
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <w2m9ryulmsgj$.1clyx8i93ob0m.dlg@40tude.net>
References: <tknbh6$142ol$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="d75414bd53a35e70853854d7c3bc3eaa";
logging-data="1186664"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/i5B8xJvInt0JOJWC48vSfav/53uZlHbE="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:fNnm5Bu08EDwGWn6wrP5RbzCAQw=
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Sat, 12 Nov 2022 06:27 UTC

On Fri, 11 Nov 2022 21:38:46 -0800, T wrote:
> Hi All,
>
> Is there a simple command line I can throw
> to tell me if I am running as administrator?
>
> Many thanks,
> -T

You can use: fsutil /?

It'll tell you by a message and ERRORLEVEL=1 if there's no admin rights.

If there's admin rights, it'll simply display fsutil's help and with
ERRORLEVEL=0.

Re: I need to check if I am running as Administrator

<tknhm4$14fiq$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=283&group=alt.msdos.batch#283

  copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T...@invalid.invalid (T)
Newsgroups: alt.msdos.batch
Subject: Re: I need to check if I am running as Administrator
Date: Fri, 11 Nov 2022 23:23:48 -0800
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <tknhm4$14fiq$2@dont-email.me>
References: <tknbh6$142ol$4@dont-email.me>
<w2m9ryulmsgj$.1clyx8i93ob0m.dlg@40tude.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 12 Nov 2022 07:23:48 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e4a96b0f517a3fa6d2eb2db7ff66bb97";
logging-data="1195610"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jWUZVThBJxZ8DIp5L+HUjuGUp6kzRyaA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:JSZpFsuyHN43LwLWTbIqrGfgSYY=
In-Reply-To: <w2m9ryulmsgj$.1clyx8i93ob0m.dlg@40tude.net>
Content-Language: en-US
 by: T - Sat, 12 Nov 2022 07:23 UTC

On 11/11/22 22:27, JJ wrote:
> On Fri, 11 Nov 2022 21:38:46 -0800, T wrote:
>> Hi All,
>>
>> Is there a simple command line I can throw
>> to tell me if I am running as administrator?
>>
>> Many thanks,
>> -T
>
> You can use: fsutil /?
>
> It'll tell you by a message and ERRORLEVEL=1 if there's no admin rights.
>
> If there's admin rights, it'll simply display fsutil's help and with
> ERRORLEVEL=0.

Windows 11 pro 22H2

C:\NtUtil>type Windows.RaidCheck.pl6.bat
@echo off
fsutil /? > nul
echo %ERRORLEVEL%

As an administrator:
C:\NtUtil>Windows.RaidCheck.pl6.bat
1

This is because
fsutil /?
/? is an invalid parameter.

RATS !!!

Re: I need to check if I am running as Administrator

<tknht4$14fiq$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=284&group=alt.msdos.batch#284

  copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T...@invalid.invalid (T)
Newsgroups: alt.msdos.batch
Subject: Re: I need to check if I am running as Administrator
Date: Fri, 11 Nov 2022 23:27:32 -0800
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <tknht4$14fiq$3@dont-email.me>
References: <tknbh6$142ol$4@dont-email.me>
<w2m9ryulmsgj$.1clyx8i93ob0m.dlg@40tude.net> <tknhm4$14fiq$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Injection-Date: Sat, 12 Nov 2022 07:27:32 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e4a96b0f517a3fa6d2eb2db7ff66bb97";
logging-data="1195610"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/zlJ4AfNfVwMhRQSK1yOt4pMIICmKI6Bo="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:jhZBB6Nig/WTWI+QanJyuFmlWzE=
Content-Language: en-US
In-Reply-To: <tknhm4$14fiq$2@dont-email.me>
 by: T - Sat, 12 Nov 2022 07:27 UTC

On 11/11/22 23:23, T wrote:
> On 11/11/22 22:27, JJ wrote:
>> On Fri, 11 Nov 2022 21:38:46 -0800, T wrote:
>>> Hi All,
>>>
>>> Is there a simple command line I can throw
>>> to tell me if I am running as administrator?
>>>
>>> Many thanks,
>>> -T
>>
>> You can use: fsutil /?
>>
>> It'll tell you by a message and ERRORLEVEL=1 if there's no admin rights.
>>
>> If there's admin rights, it'll simply display fsutil's help and with
>> ERRORLEVEL=0.
>
> Windows 11 pro 22H2
>
> C:\NtUtil>type Windows.RaidCheck.pl6.bat
> @echo off
> fsutil /? > nul
> echo %ERRORLEVEL%
>
>
> As an administrator:
> C:\NtUtil>Windows.RaidCheck.pl6.bat
> 1
>
>
> This is because
>    fsutil /?
>    /? is an invalid parameter.
>
> RATS !!!
>
>
>
>

Hi JJ,
You put me on the right path though
As a user:
net sessions & echo %ERRORLEVEL%
System error 5 has occurred.
Access is denied.
2

As an Administrator:
net sessions & echo %ERRORLEVEL%
There are no entries in the list.
0

Thank you!

Re: I need to check if I am running as Administrator

<1u3970g77utcr.5838fxzli9xc.dlg@40tude.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=287&group=alt.msdos.batch#287

  copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4pub...@outlook.com (JJ)
Newsgroups: alt.msdos.batch
Subject: Re: I need to check if I am running as Administrator
Date: Sat, 12 Nov 2022 19:05:17 +0700
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <1u3970g77utcr.5838fxzli9xc.dlg@40tude.net>
References: <tknbh6$142ol$4@dont-email.me> <w2m9ryulmsgj$.1clyx8i93ob0m.dlg@40tude.net> <tknhm4$14fiq$2@dont-email.me> <tknht4$14fiq$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="d75414bd53a35e70853854d7c3bc3eaa";
logging-data="1235935"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX190kCErcjHmGhqZLYPDx2+J5ajiUfV2Pjs="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:Vjz1gsdoXFWcn4YGJcuuIRpKghc=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Sat, 12 Nov 2022 12:05 UTC

On Fri, 11 Nov 2022 23:27:32 -0800, T wrote:
> On 11/11/22 23:23, T wrote:
>>
>> Windows 11 pro 22H2
>>
>> C:\NtUtil>type Windows.RaidCheck.pl6.bat
>> @echo off
>> fsutil /? > nul
>> echo %ERRORLEVEL%
>>
>> As an administrator:
>> C:\NtUtil>Windows.RaidCheck.pl6.bat
>> 1
>>
>> This is because
>>    fsutil /?
>>    /? is an invalid parameter.
>>
>> RATS !!!
>>
>
> Hi JJ,
>
> You put me on the right path though
>
> As a user:
>
> net sessions & echo %ERRORLEVEL%
> System error 5 has occurred.
>
> Access is denied.
>
> 2
>
> As an Administrator:
>
> net sessions & echo %ERRORLEVEL%
> There are no entries in the list.
>
> 0
>
> Thank you!

Whoops. With fsutil, the /? shouldn't be specified. i.e. just `fsutil`
without any command line argument.

Another alternative which is longer to type but not without advantages, is
to simply check the content of the `systemprofile` folder. e.g.

@echo off
if exist %systemroot%\system32\config\systemprofile\* (
echo elevated
) else (
echo not elevated
)

Or try going into that folder...

@echo off
2>nul pushd %systemroot%\system32\config\systemprofile
if errorlevel 1 (
echo not elevated
) else (
popd
echo elevated
)

The advantages of checking that folder is because it's faster than executing
a tool. And a tool may be blocked by group policy, or be excluded by
debloater software from the OS installer to create a minimal OS installation
which is intended to only do specific thing.

Re: I need to check if I am running as Administrator

<tkp5hk$18eig$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=290&group=alt.msdos.batch#290

  copy link   Newsgroups: alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T...@invalid.invalid (T)
Newsgroups: alt.msdos.batch
Subject: Re: I need to check if I am running as Administrator
Date: Sat, 12 Nov 2022 14:08:52 -0800
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <tkp5hk$18eig$1@dont-email.me>
References: <tknbh6$142ol$4@dont-email.me>
<w2m9ryulmsgj$.1clyx8i93ob0m.dlg@40tude.net> <tknhm4$14fiq$2@dont-email.me>
<tknht4$14fiq$3@dont-email.me> <1u3970g77utcr.5838fxzli9xc.dlg@40tude.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Injection-Date: Sat, 12 Nov 2022 22:08:53 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e4a96b0f517a3fa6d2eb2db7ff66bb97";
logging-data="1325648"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nQANLvFPDRwJWBpUaH31p0S4a+o85k4w="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:DdCJ0SoAKmCutXuCGqNupO2MSnM=
Content-Language: en-US
In-Reply-To: <1u3970g77utcr.5838fxzli9xc.dlg@40tude.net>
 by: T - Sat, 12 Nov 2022 22:08 UTC

On 11/12/22 04:05, JJ wrote:
> On Fri, 11 Nov 2022 23:27:32 -0800, T wrote:
>> On 11/11/22 23:23, T wrote:
>>>
>>> Windows 11 pro 22H2
>>>
>>> C:\NtUtil>type Windows.RaidCheck.pl6.bat
>>> @echo off
>>> fsutil /? > nul
>>> echo %ERRORLEVEL%
>>>
>>> As an administrator:
>>> C:\NtUtil>Windows.RaidCheck.pl6.bat
>>> 1
>>>
>>> This is because
>>>    fsutil /?
>>>    /? is an invalid parameter.
>>>
>>> RATS !!!
>>>
>>
>> Hi JJ,
>>
>> You put me on the right path though
>>
>> As a user:
>>
>> net sessions & echo %ERRORLEVEL%
>> System error 5 has occurred.
>>
>> Access is denied.
>>
>> 2
>>
>> As an Administrator:
>>
>> net sessions & echo %ERRORLEVEL%
>> There are no entries in the list.
>>
>> 0
>>
>> Thank you!
>
> Whoops. With fsutil, the /? shouldn't be specified. i.e. just `fsutil`
> without any command line argument.
>
> Another alternative which is longer to type but not without advantages, is
> to simply check the content of the `systemprofile` folder. e.g.
>
> @echo off
> if exist %systemroot%\system32\config\systemprofile\* (
> echo elevated
> ) else (
> echo not elevated
> )
>
> Or try going into that folder...
>
> @echo off
> 2>nul pushd %systemroot%\system32\config\systemprofile
> if errorlevel 1 (
> echo not elevated
> ) else (
> popd
> echo elevated
> )
>
> The advantages of checking that folder is because it's faster than executing
> a tool. And a tool may be blocked by group policy, or be excluded by
> debloater software from the OS installer to create a minimal OS installation
> which is intended to only do specific thing.

Fancy stuff. Thank you.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor