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
Solved

Batch File Server 2008

Posted on 2010-08-26
8
892 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
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.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

860 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