Solved

Batch File Server 2008

Posted on 2010-08-26
8
888 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:triphen
  • 4
  • 4
8 Comments
 
LVL 4

Expert Comment

by:zmorvik
ID: 33534593
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.
0
 

Author Comment

by:triphen
ID: 33534697
The very first app to start is C:, that one already gives the error. So i dont think its that,
0
 

Author Comment

by:triphen
ID: 33534727
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

0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 4

Expert Comment

by:zmorvik
ID: 33535040
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
0
 

Author Comment

by:triphen
ID: 33535311
Same thing, I added the C: and the Reg Dword.....any other ideas?
0
 
LVL 4

Accepted Solution

by:
zmorvik earned 500 total points
ID: 33535362
what if you copy the batch file to a local folder and run it there?  Is that the entire batch file or only part of it?

I tried on a 2008 R2 machine with the batch file stored both locally and on the network and it ran with this code inside:

REM @echo off
ping -n 2 127.0.0.1 > NUL
start /D"C:\Program Files (x86)\Microsoft Office\Office12" /MIN /B WINWORD.exe

I did not try adding to a user login script to test when a user logs in, but I can.

What about the PAUSE?  Does it fail on the ping as well or only on the start?
0
 

Author Comment

by:triphen
ID: 33535396
ERRRRRRRR, I just saw the problem..

Program Files (x86) vs Program Files :)

Blonde moment.....thats why it works in XP :)
0
 
LVL 4

Expert Comment

by:zmorvik
ID: 33535421
Excellent!  So glad you noticed that.  I should have asked 32 or 64 bit as well.  Glad it's working!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question