I'm have local access to a shared folder with credentials.
net use Z: \\server\folder /u:user /persistent:yes passwd
The files in this folder are to be used by other processes.
The problem is that when the machine is restarted, the connection is lost, meaning that I can see that the Network Device Z is there, but it does not automatically connect to it, so that the processes have no longer access to the folder.
I have tried several solutions with no avail:
Creating a Windows scheduled task to run a script with 'net use Z:...',
a. with my_user I get this error in Event Viewer: "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID"
b. with System, I get no errors but the connection is not created. I've tried to log stdout and stderr to debug the script, but it does not even create the log file. (The used script is shown below)
@echo off '> map.log 2>&1( net use Z: \server\folder /u:user /persistent:yes passwd )
Crating a Symlink was another solution I had found, but it is not suitable for my case, because it does not allow credentials. It seems that the resource has to be either unprotected or already available locally.
Creating a Startup Script from Local Group Policy Editor, I get the same error in Event Viewer
Running 'net use Z:...' via a Python script installed ad Windows Service,
import subprocess proc=subprocess.Popen(r'net use Z: \server\folder /u:user pass', shell=True) out, err = proc.communicate() print("out:%s, err:%s"%(out,err))
If I run the python script manually, it works, while running it as a service creates a disconnected drive.
Can anyone give me an advice on how to proceed? Thanks