Metanis
Well-Known Member
- Reaction score
- 896
- Location
- Medford, WI, USA
Curiouser and curiouser . . .
I moved the BAT file to common startup rather than user startup, same issue. But, and it was a "but" I had not realized, it appears that either the message about not being able to map the network drive is spurious, or it's occurring because the attempt from "persistent" is occurring before Windows 11 is able to deal with networking.
If I wait a few moments after the error message regarding drive mapping appears, as boot progresses I see the "telltale flash" of the command prompt window running for the BAT file which issues the "net use" command again. If I open File Explorer then, the drive is mapped and functioning perfectly. At the same time, the icon that shows the problem persists for quite a while after that, even when all is fat and happy.
I also discovered that the /savecred and /persistent:yes switches conflict with each other. The /persistent:yes switch results in a successful connection again (along with the login credentials, of course) but /savecred doesn't.
This is just freakin' bizarre, as far as I'm concerned. But at least there is now access to the server drive from this machine. When it's time to set up the next CAD workstation, I'm sticking to using the owner's personal MS account to link to. I don't want to have to go through this crap again, and the other machines where I used that method allowed me to enter userid/password credentials and check the "remember" checkbox for the server connection and have been perfectly happy ever since!
I've run into this in the past. As I recall it has something to do with the "scope" of a CMD or BAT file during boot. It has to be "global" so the mapping doesn't just disappear as soon as the batch file ends.
I think I worked around this by creating a shortcut to the batch file. Then I was able to use the compatibility settings for the shortcut to Always Run As Administrator. But my memory is hazy.
Then just to muddy the waters, you could also use GPEDIT.MSC on a Pro machine and explicitly define a login script file. This would be your existing batch file that you add to C:\Windows\System32\GroupPolicy\User\Scripts\Logon and define a policy object at Local Computer Policy\User Configuration\Windows Settings\Scripts.
Another trick is to use Task Scheduler and trigger the batch file to run 1 minute after boot. By then the network processes have all stabilized. Again, you would want to run it as administrator.