We're going to be installing some new software on pretty much all of our computers and I'm trying to setup a GPO to do it. We're running a Windows Server 2008 R2 domain controller and all of our machines are Windows 7.
The GPO calls the following script which sits on a network share on our file server. The script it self calls an executable that sits on another network share on another server. The executable will imediatelly crash with an error 0x0000006
. The event log just says this: Windows cannot access the file for one of the following reasons: there is a problem with the network connection, the disk that the file is stored on, or the storage drivers installed on this computer; or the disk is missing. Windows closed the program Setup.exe because of this error.
Here's the script (which is stored on \\WIN2K8R2-F-01\Remote Applications
):
@ECHO OFF
IF DEFINED ProgramFiles(x86) (
ECHO DEBUG: 64-bit platform
SET _path="C:\Program Files (x86)\Canam"
) ELSE (
ECHO DEBUG: 32-bit platform
SET _path="C:\Program Files\Canam"
)
IF NOT EXIST %_path% (
ECHO DEBUG: Folder does not exist
PUSHD \\WIN2K8R2-PSA-01\PSA Data\Client
START "" "Setup.exe" "/q"
POPD
) ELSE (
ECHO DEBUG: Folder exists
)
Running the script manually as administrator also results in the same error. Setting up a shortcut with the same target and parameters works perfectly. Manually calling the executable also works.
Not sure if it matters, but the installer is based on dotNETInstaller. I don't know what version though.
I'd appreciate any suggestions on fixing this. Thanks in advance!
UPDATE
I highly doubt this matters, but the network share that the script is hosted in is a shared drive, while the network share the script references for the executable is a shared folder.
Also, both shares have Domain Computers
listed with full access for the sharing and security tabs. And PUSHD
works without wrapping the path in quotes.
UPDATE 2
If I manually open CMD on the client machine and enter PUSHD "\\WIN2K8R2-PSA-01\PSA Data\Client"
I get the directory mounted as a drive properly. If I then enter START "" "Setup.exe" "/q"
the installer kicks in exactly as it should and it actually installs the application.
UPDATE 3
While doing some debugging through ECHO
statements, I started outputting TXT
files to the C:\
drive on the client machine. After I called PUSHD
I ECHO
ed %CD%
to see what the current directory was. It ended up outputting C:\Windows
not {?}:\Client
like it should if it succesfully mounted the remote directory.
I think it has something to do with the messages I get at the very top of the screen that UNC paths are not supported, blah blah blah, even though the rest of the script actually executes.
Still looking for suggestions on getting this to work.
Sounds like a permission issue. If you're doing this in a startup script it will run as
SYSTEM
. You'll need to giveDomain Computers
read access to where the files are stored.Put quotes around the share path. You've got a space in the share name and I'm assuming that's what's causing the problem.
Suggestions that might help you.
1)
You can use sysinternal's psexec to open a cmd window as SYSTEM for debugging "psexec \127.0.0.1 /s cmd" From there you can walk through the script "line by line" to see where it fails
2)
You can modify the script so it runs in the current dir with the "%~dp0" prefix
Have you tried skipping the START command?
The problem is that you popd out before the setup finishes. This is because cmd starts the setup and immedeately goes on with the popd command.
you can also use the UNC path. Maybe you need quotes.