Link to home
Start Free TrialLog in
Avatar of triphen
triphen

asked on

Batch File Server 2008

Hello Experts,

I have a batch file that starts up different programs with a delay in between. Some of these programs launch from C: some one them launch from UNC (\\servername\etc) the UNCs are fine but everyone of the C: I get an error that says "The current directory is invalid." I tried adding a C: at the beginning of the batch file but that didnt help. Any ideas?

By thw way this is Server 2008 Foundation I am using, this SAME batch file executes on WinXP with NO problems.
Avatar of zmorvik
zmorvik

When you execute a UNC your current directory is changing to that network location.

After each UNC call add:
c:
cd\

without seeing more of the batch file, those are my first thoughts.
Avatar of triphen

ASKER

The very first app to start is C:, that one already gives the error. So i dont think its that,
Avatar of triphen

ASKER

Here is the batch file
@echo off
ping -n 12 127.0.0.1 > NUL
start /D"C:\Program Files\SQL Anywhere 10\win32" /MIN /B db10.exe C:\SQL\SQLBASE10.db -n SQLbase -x TCPIP -ti 0 -c 128M -qp

@echo off
ping -n 8 127.0.0.1 > NUL
start /D"\\server\folder" /MIN /B Manager.exe

@echo off
ping -n 5 127.0.0.1 > NUL
start /D"\\server\folder" /MIN /B AuthManager.exe

@echo off
ping -n 5 127.0.0.1 > NUL
start /D"\\server\folder" /MIN /B Stock.exe

@echo off
ping -n 5 127.0.0.1 > NUL
start /D"C:\folder\Data\Server" /MIN /B RepSrv.exe

Open in new window

For testing, REM the @echo off

put a PAUSE after the ping and the start line.

Something else to try, just after the @echo off, add
C:

I believe because it is starting from the network, it is essentially starting from UNC

One thing to try is on this 2008 server, change/create this registry key:
[HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
"DisableUNCCheck"=dword:00000001
Avatar of triphen

ASKER

Same thing, I added the C: and the Reg Dword.....any other ideas?
ASKER CERTIFIED SOLUTION
Avatar of zmorvik
zmorvik

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of triphen

ASKER

ERRRRRRRR, I just saw the problem..

Program Files (x86) vs Program Files :)

Blonde moment.....thats why it works in XP :)
Excellent!  So glad you noticed that.  I should have asked 32 or 64 bit as well.  Glad it's working!