I have 2 scripts configured via GPO (User configuration>policies>windows configuration>scripts>logon)
script1.bat
@echo off
net use s: /delete
net use s: <address> /user:<user> <password> /persistent:yes
I provide a username and password because the access is to a Linux server that is not on the domain
script2.vbs
Set oShell = CreateObject("Shell.Application")
oShell.NameSpace("s:").Self.Name = "label"
When the user logs in it shows the following error
Windows Script Host
Script: script2.vbs
Line: 2
Character: 1
Error: Necessary object: 'oShell.NameSpace(...)'
Code: 800A01A8
Source: Microsoft VBScript Runtime Error
If I run the script2.vbs manually and locally after logging in, the network drive is renamed without any error.
New contributor
Pablo Monteiro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.