Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 ECHOed %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.

share|improve this question
    
I think in the end you'll need to do both joequerty's and mdarras answers. –  tony roth Oct 26 '12 at 3:08
    
For PUSHD, it works fine without the quotes and for the permissions, I already had Domain Computers added to both locations under sharing and security properties. –  Alex Oct 26 '12 at 4:19

4 Answers 4

up vote 2 down vote accepted

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?

PUSHD \WIN2K8R2-PSA-01\PSA Data\Client

%~dp0Setup.exe" "/q"

share|improve this answer
    
I tried what you suggested, but I'm getting this as an error: ... is not recognized as an internal or external command, operable program or batch file. –  Alex Oct 26 '12 at 21:12
    
I... love you... So, I got rid of the START as you suggested and it just worked. Thanks! –  Alex Oct 26 '12 at 21:42

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.

share|improve this answer
    
I assume you're talking about the PUSHD part. I tested it in CMD on it's own and it works without the quotes. –  Alex Oct 26 '12 at 4:15
    
Whenever I've had a path with spaces in a script I've had to put quotes around it. Have you tried putting quotes around the path? You've got nothing to lose by trying it. –  joeqwerty Oct 26 '12 at 4:42
    
I tried it just for the sake of trying and the end result is identical. –  Alex Oct 26 '12 at 14:48

Sounds like a permission issue. If you're doing this in a startup script it will run as SYSTEM. You'll need to give Domain Computers read access to where the files are stored.

share|improve this answer
    
That's what I thought as well, and already placed Domain Computers with full access for both sharing and security on both locations. –  Alex Oct 26 '12 at 4:19

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.

Use start "" Setup.exe /wait /q

you can also use the UNC path. Maybe you need quotes.

start "Setup title" "\\server\share\folder\setup.exe" /q
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.