make "Permissions" stick on a shared drive on a Win10 laptop

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 11839
Joined: 24 Jan 2010, 23:23
Location: paused.undefined.exposed

make "Permissions" stick on a shared drive on a Win10 laptop

Post by ChrisGreaves »

Please see also Weird case of "Administrator Privileges" at boot time.
A 355KB DOC is available at www.chrisgreaves.com/Downloads/Win10Ass ... Folder.doc. This post text is at the foot of the document("Thursday, February 11, 2021")

How can I make "Permissions" stick on a shared drive on a Win10 laptop?
I am driven crazy trying to resolve an issue I first raised back in 2010. I tried then and have tried since to rid myself of SUBST.

Yesterday I managed to name my laptop computer "AT" and produced a share "T" which is my data drive T: (a Veracrypt decrypted partition)
I have a batch file ( NetUse.bat attached) which works once T is given permissions. The Batchfile is called repeatedly from my autoexec.bat.

The problem as I see it is that my boot-time batch file works only after I have manually intervened to reset permissions on the shared T which is assigned to T: which is my Veracrypt partition (after decryption)
Share010.png
The image above shows my manipulation to check ON full permission on the share "T" to Everyone. Yes, Everyone is risky, but until I can get this to work I'll be lenient.
Share011.png
Once the permissions are re-issued manually at reboot time, the batch file runs quite happily. In the image above I have made three fake drives S:, V:, and W: that save me time by giving me speedy access to lengthy folder trees.

I am not only confounded by the hurdles imposed by MSWindows, but eternally grateful for any pointers that show me "what I am doing wrong".
Thanks
Chris
You do not have the required permissions to view the files attached to this post.
Last edited by ChrisGreaves on 21 Feb 2021, 22:39, edited 1 time in total.
Today the future is turning into the past.

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

Re: make "Permissions" stick on a shared drive on a Win10 laptop

Post by StuartR »

How are you sharing T

You could try using a line like this in your BAT file

Code: Select all

NET SHARE Sharename=T: /GRANT:Everyone,FULL
(where sharename is the name you gave the share)
StuartR


User avatar
ChrisGreaves
PlutoniumLounger
Posts: 11839
Joined: 24 Jan 2010, 23:23
Location: paused.undefined.exposed

Re: make "Permissions" stick on a shared drive on a Win10 laptop

Post by ChrisGreaves »

StuartR wrote:
12 Feb 2021, 08:22

Code: Select all

NET SHARE Sharename=T: /GRANT:Everyone,FULL
A 666KB DOC is available at http://www.chrisgreaves.com/Downloads/Win10AssignDriveLetterToFolder.doc. This post text is at the foot of the document("Friday, February 12, 2021")

I have a working reboot system, although it needs a good haircut.

(1) In "C:\Users\Chris074\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" I have a file "AutoSimple.bat"

Code: Select all

set pause=pause
echo This is %0 running
%pause%
start "" "C:\Users\Chris074\AppData\Roaming\Microsoft\Windows\Start Menu\AutoExec.bat - Shortcut.lnk"
%pause%
(2) Two folders up in "C:\Users\Chris074\AppData\Roaming\Microsoft\Windows\Start Menu" I have a file "AutoExec.bat" and a shortcut link to that file.

(3) The file "AutoExec.bat" is a stripped-down version of my normal all-singing all-dancing AutoEexc.bat file.

Code: Select all

:: AutoExec.bat held in C:\Users\Chris074\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
set pause=pause
::	Mount the encrypted drive
if not exist T: "C:\Program Files\VeraCrypt\VeraCrypt.exe" /q /l T /v \Device\Harddisk1\Partition4
%pause%
:: Grant Permissions to the share "T"  https://eileenslounge.com/viewtopic.php?p=280748&sid=bb31f06354b6050842d267f1b98c7826#p280748
NET SHARE T=T: /GRANT:Everyone,FULL
%pause%
timeout /T 5
%pause%
:: Mount a shortcut drive "S:" where "S"==="Stain" (application folder)
net use S: /DELETE
%pause%
net use S: \\AT\T\Greaves\Products\USER\Stain /PERSISTENT:YES
%pause%
(4) The assignment of drive S: reports to be working in the AutoExec.bat, but drive S: does not appear in Explorer.

(5) A subsequent run of my Fakes.bat (attached) makes all four drives (S:, U:, V: and W:) appear in Explorer.

Thanks to Stuart for getting me over this hurdle and to the Finish Line! :clapping: :chocciebar: :cheers: :thankyou:

Chris
You do not have the required permissions to view the files attached to this post.
Today the future is turning into the past.

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

Re: make "Permissions" stick on a shared drive on a Win10 laptop

Post by StuartR »

:thumbup:
StuartR