Solved

Batch File Server 2008

Posted on 2010-08-26
8
900 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

724 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