Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

Need Help with a Batch File

  • Please log in to reply



    New Member

  • Member
  • Pip
  • 2 posts
I am running Windows XP pro on a laptop. I am trying how to conditional launch some programs based on my hardware profile. WHen I am docked, I want to launch some programs that I do not want to launch when the laptop is not docked.

I was trying to use a batch file and DEVCON, but I am not having any success.

I wrote a batch file in to see if DEVCON sees the docking station.

devcon status ACPI\DOCK*| find "running"
ECHO errorlevel: %errorlevel%
IF errorlevel 0 GOTO SUBA


I do get "0" returned when the docking station is not present and "1" returned when it is not. However, in either case the "SUBA" commands are executing. I only want to run SUBA when the docking station is not present.

What am I doing wrong?

Thanks for your help and time.
  • 0





  • Member
  • PipPipPip
  • 875 posts
try adding exit, as below:

IF errorlevel 0 GOTO SUBA

  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP