Weird case of "Administrator Privileges" at boot time.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Weird case of "Administrator Privileges" at boot time.

Post by ChrisGreaves »

This thread follows on from make the thread "Permissions" stick on a shared drive on a Win10 laptop"

A boot sequence (as in the attached Auto2019.bat) needs to share a (“mapped”?) drive with the command “NET SHARE T=T: /GRANT:Everyone,FULL”.
The user is “Chris074” with Administrator privileges.
UAC is set to its lowest level (“never notify”).

When the batch file is run from C:\Users\Chris074\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup, the NET SHARE command fails with the traditional “SYSTEM ERROR 5”.
When the batch file is run manually from a desktop shortcut link, with the link’s properties set to “Run As Administrator”, the NET SHARE command succeeds.
When a copy of the shortcut link is copied to the StartUp folder, the NET SHARE command fails with the traditional “SYSTEM ERROR 5”

The user (Chris074) does not want to execute a shortcut link manually. He reasons that he should be able to boot automatically. The user has tried myriad combinations with no success. (please see the 1,611KB document down at the foot "Sunday, February 21, 2021")

Again:
(1) The shortcut link works when executed manually from the desktop by Chris074.
(2) The shortcut link does not work when executed automatically from the startup folder by Chris074.
(3) Chris074 has Administrator privileges and UAC is set low (“never notify”)
(4) The batch file works when the file itself is in Administrator’s startup folder and Administrator is logged in.

I beg for suggestions to resolve this.
I can run as Administrator but it seems that I would have to spend almost as much time configuring Administrator’s Win10 and applications as I would doing a factory reset and re-installation.

Thanks in Advance
Chris
You do not have the required permissions to view the files attached to this post.
An expensive day out: Wallet and Grimace

User avatar
StuartR
Administrator
Posts: 12577
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Weird case of "Administrator Privileges" at boot time.

Post by StuartR »

Use task scheduler to run the task at startup (or after login). This lets you specify that it runs with full admin privileges.
StuartR


User avatar
DaveA
GoldLounger
Posts: 2599
Joined: 24 Jan 2010, 15:26
Location: Olympia, WA

Re: Weird case of "Administrator Privileges" at boot time.

Post by DaveA »

At the time of the startup, the network may not be fully started.
And you (Chris074) is NOT logged in!
I am so far behind, I think I am First :evilgrin:
Genealogy....confusing the dead and annoying the living

User avatar
John Gray
PlatinumLounger
Posts: 5401
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Weird case of "Administrator Privileges" at boot time.

Post by John Gray »

Wot Stuart and DaveA sed!

Also, you can save all that tedious typing of
/PERSISTENT:YES
by using
/p:y
throughout!
John Gray

Venison is quiet deer, and quite dear.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Weird case of "Administrator Privileges" at boot time.

Post by ChrisGreaves »

StuartR wrote:
22 Feb 2021, 09:55
Use task scheduler to run the task at startup (or after login). This lets you specify that it runs with full admin privileges.
Untitled.png
Yee-haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah!
Thank you Stuart.

Now that it is working properly, I can add one or two improvements :evilgrin:
:thankyou:
Chris
You do not have the required permissions to view the files attached to this post.
An expensive day out: Wallet and Grimace

User avatar
StuartR
Administrator
Posts: 12577
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Weird case of "Administrator Privileges" at boot time.

Post by StuartR »

Nice to see a result. Thank you.
StuartR


User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Weird case of "Administrator Privileges" at boot time.

Post by ChrisGreaves »

DaveA wrote:
22 Feb 2021, 16:43
At the time of the startup, the network may not be fully started.
And you (Chris074) is NOT logged in!
Hi Dave.
As you will see by my post-task-scheduler post, it is working.
To me the strange thing is that everything worked in part, but not together.
Remember that it all worked when I executed the shortcut link by double-clicking on the desktop icon (with "Run as Administrator")
I believe that that time that I was logged in.
It worked when I executed the commands line-by-line at the command prompt.
I believe that that time that I was logged in.

As to whether one was logged in, when I switched to Administrator account, that worked flawlessly, so I figured that it was not so much whether I was logged in as much as whether my Chris074 status as administrator was recognized.

Now you may have noticed the various TimeOuts and Pauses scattered throughout the batch file. These, coupled with "I'll grab a coffee" diversions had surely given Windows enough time to collect its wits.

I can't rule out login or timing problems; it's just that I made so many different essays from every angle I could think of, and none of them worked.

Overall of course I grew up with the DOS Config.sys and Autoexec.bat files and expected them to keep working.

After spending what seems like half my life over the past four weeks trying to get the Net Use working (replacing my SUBST), I am quite willing to carry on further experiments if you can think of one.

All in all it seems strange to me that in all my web-readings I did not come across any suggestion of using Task Scheduler.
Of course, only folks with access to Our Unique Stuart are so blessed!
Cheers
Chris
Last edited by ChrisGreaves on 22 Feb 2021, 23:57, edited 1 time in total.
An expensive day out: Wallet and Grimace

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Weird case of "Administrator Privileges" at boot time.

Post by ChrisGreaves »

StuartR wrote:
22 Feb 2021, 17:30
Nice to see a result. Thank you.
Stuart, this is not what I would call a result.
Ten years have passed since I started trying to rid myself of SUBST.
We must find a better word than result!
Cheers
Chris
An expensive day out: Wallet and Grimace

User avatar
StuartR
Administrator
Posts: 12577
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Weird case of "Administrator Privileges" at boot time.

Post by StuartR »

:thumbup:
StuartR


User avatar
John Gray
PlatinumLounger
Posts: 5401
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Weird case of "Administrator Privileges" at boot time.

Post by John Gray »

ChrisGreaves wrote:
22 Feb 2021, 17:40
Ten years have passed since I started trying to rid myself of SUBST.
We must find a better word than result!
Perhaps phrases like gradual enlightenment or minimal progress would be apposite? :laugh: :thumbup:
John Gray

Venison is quiet deer, and quite dear.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Weird case of "Administrator Privileges" at boot time.

Post by ChrisGreaves »

ChrisGreaves wrote:
21 Feb 2021, 22:37
... When the batch file is run from C:\Users\Chris074\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup, the NET SHARE command fails with the traditional “SYSTEM ERROR 5”.
Except for cleaning up my batch file (for example, removing the PAUSE commands) I have no intention of changing anything; the boot sequence maps my drives and that was my goal.
That said, I think that the problem is related to "administrator privileges" and "the startup folder".
I have found the following links to suggest other paths to solution; in general these links suggest Task Scheduler and Registry Keys. I have read the pages but have not tested any of the solutions.
Cheers
Chris
https://duckduckgo.com/?t=ffab&q=when+d ... ted&ia=web

https://stackoverflow.com/questions/136 ... ws-startup
https://attack.mitre.org/techniques/T1547/001/
https://answers.microsoft.com/en-us/win ... 051450366a
https://www.advancedinstaller.com/forum ... hp?t=30801
https://bitpage.de/en/windows-10-doesnt ... p-scripts/
https://www.devdungeon.com/content/wind ... pt-startup
C
An expensive day out: Wallet and Grimace

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Weird case of "Administrator Privileges" at boot time.

Post by ChrisGreaves »

John Gray wrote:
23 Feb 2021, 08:22
Perhaps phrases like gradual enlightenment or minimal progress would be apposite? :laugh: :thumbup:
Hearty thanks, John. I'll get onto this as soon as I have finished painting the bathroom door :grin:
Cheers
Chris
An expensive day out: Wallet and Grimace

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Weird case of "Administrator Privileges" at boot time.

Post by ChrisGreaves »

ChrisGreaves wrote:
21 Feb 2021, 22:37
This thread follows on from make the thread "Permissions" stick on a shared drive on a Win10 laptop"
I am not finished, but I thought to post a snapshot(attached) of the boot batch file as it is today. There is much tidying up to be done, but I want to get the mechanics working BEFORE I format it nicely.

When I [re]boot, the batch file:-
  1. Mounts the encrypted data partition as drive T:
  2. Makes a folder with today's 8-digit date within the folder T:\Blotter
  3. Shares as B:today's (empty) desktop blotter ; this is a working area for whatever I do today that does NOT have its own folder.
  4. Shares as A: my projects user data folders C:\Users\Chris074\AppData\Roaming\Greaves\
  5. Shares as D:, I:, S:, U:, V:, W: and X: the folders for the projects currently in work
  6. Slides a new random wallpaper from a collection of 4,000+ into the set of six and slides the stalest out, so that I don't get bored.
Thanks to all who contributed to getting me this far.
Chris
You do not have the required permissions to view the files attached to this post.
An expensive day out: Wallet and Grimace

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Weird case of "Administrator Privileges" at boot time.

Post by ChrisGreaves »

ChrisGreaves wrote:
21 Feb 2021, 22:37
This thread follows on from make the thread "Permissions" stick on a shared drive on a Win10 laptop"
And then in the wee hours of this morning I found this link, and on Page 2 of 22 pages of responses:-
The BuiltIn Admin account is not what it was in Windows 7. In Windows 10, the BuiltIn Admin account has severely limited capabilities and is really only useful for its intended purpose of creating other Admin accounts with which to carry out normal Admin tasks.
Having a bit of free time on my hands, I created a new user CHRIS075a with Local Administrator privileges and to my surprise and wonder, the Auto.bat in my folder C:\Users\Chris075\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup fired up (and decrypted my encrypted data drive)
[next day] Please note that it is the Chris075, original user, that has woken up to Administrator privileges. I do not know why creating Chris075a should awaken Chris075, but I am happy!

Based on the text quoted above, when Win10 is installed, the "default" user is basically a boot-strap device, just to get you started.
I don't recall seeing any caution about this as I reinstalled Win10; nothing along the lines of " ... you know, this isn't a real account ..."

I did find this a bit alarming, at my age :-
IMG_20210701_040621999 (Copy).jpg
I'm going to bed now.
Cheers
Chris
You do not have the required permissions to view the files attached to this post.
An expensive day out: Wallet and Grimace