Jump to content

Recommended Posts

Posted (edited)

Hi, im trying to run a batch file on startup which uninstalls some software.

MsiExec.exe /qn /X{B7C5EA94-B96A-41F5-BE95-25D78B486678}

The GPO is applied to the machine but failes to run the script.

 

The script is located in the Sysvol policies startup folder. The share has read permissions for everyone and the bat file has full control for system, and read & execute for authenticated users.

 

Event viewer logs the following.

 

Eventid: 1130

ErrorCode: 2

ErrorDecription: The system cannot find the file specified.

GPOFileSystemPath: \\DomainName\SysVol\DomainName\Policies\{C4AFE593-28FA-4ABA-B880-63E386AE8B43}\Machine

GPOScriptCommandString UninstallSplashtop.bat

 

I then tried creating a seperate share with full control for everyone. Then on the script had System - Full Control. Domain Comuters - Read & execute. Authenticated Users - Read & execute.

 

This also failed but with different error:

 

Eventid: 1130

ErrorCode: 53 ErrorDescription: The network path was not found.

GPOFileSystemPath: \\DomainName\SysVol\DomainName\Policies\{C4AFE593-28FA-4ABA-B880-63E386AE8B43}\Machine

GPOScriptCommandString: \\DomainController\uninstall$\UninstallSplashtop.bat

The batch file works when i run it manually from the policy folder, however I get this message which could be the issue why it doesnt run on startup:

 

'\\DomainName\SysVol\DomainName\Policies\{C4AFE593-28FA-4ABA-B880-63E386AE8B43}\Machine\Scripts\Startup' CMD.EXE was started with the above path as the current directory.

UNC paths are not supported. Defaulting to Windows directory.

C:\Windows\MsiExec.exe /qn /X{B7C5EA94-B96A-41F5-BE95-25D78B486678}

 

I have also got the GPO: 'Always wait for the network at computer startup and logon' enabled.

 

Any ideas?

Edited by Tom_P
Posted
UNC paths are not supported. Defaulting to Windows directory.C:\Windows\MsiExec.exe /qn /X{B7C5EA94-B96A-41F5-BE95-25D78B486678}

 

Is this text correct? Only, Msiexec.exe doesn't exist in C:\Windows, it lives in C:\Windows\System32 on Windows 10.

 

When calling msiexec from a startup script, I usually either call directly msiexec (no .exe), or with the path, %WINDIR%\System32\MsiExec.exe.

 

Perhaps try one of those other options and see if it makes a difference. When scripts don't run in my experience, it's because they either cannot find the file your calling, or cannot access it. My money's on the former.

  • Thanks 1
Posted (edited)
Is this text correct? Only, Msiexec.exe doesn't exist in C:\Windows, it lives in C:\Windows\System32 on Windows 10.

When calling msiexec from a startup script, I usually either call directly msiexec (no .exe), or with the path, %WINDIR%\System32\MsiExec.exe. Perhaps try one of those other options and see if it makes a difference.

When scripts don't run in my experience, it's because they either cannot find the file your calling, or cannot access it. My money's on the former.

Yes, the text is wrong. Typo on my part as was copying from a screenshot:doh:

 

That makes sense, i will give this a try - thank you:)

Edited by Tom_P
  • 1 year later...
Posted
It seems like you're facing challenges with running a batch file at startup via GPO. From your troubleshooting, it appears there are issues with UNC paths not being supported during startup, which defaults to the Windows directory, causing an error in the network path not found. To resolve this, consider placing the batch file directly on the local machine and ensure permissions are set correctly for local execution. Also, check network connectivity and event logs for more specific errors related to startup scripts.
Posted

A common issue is that the computer boots before the network is connected. It becomes more of a problem with SSD.

 

Maybe try setting it as a shutdown script?

Posted

You are correct CMD does not support UNC, you will have do do a drive mapping first,

 

net use z: \\DomainName\SysVol\DomainName\Policies\{C4AFE593-28FA-4ABA-B880-63E386AE8B43}\Machine

msisexc z:\filename

Net use /delete z:

 

Alternative Powershell does support UNC, but that is often disabled.

Posted
Or set the computers to wait for network before continuing

 

This is the route I would take first. If you can't see UNCs at boot, then better to fix the reason you cannot see UNCs at boot, than try and work around it.

 

We've got plenty of scripts running on UNC paths, including those that kick off MSI installers, never needed to copy files to the local drive, or, use drive letters. The GPO setting name is "Always Wait for the Network at Computer Startup and Logon"

 

(also, apologies to OP if this is long since resolved - the original question was over a year ago)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...