Jump to content

Issue with a batch file


manuk

Recommended Posts

I use an app in myoffice that requires me to disable the network before launching it. Once the app is launched, I can enable the network again.

As a workarpund, I created a batch file that disables the network, launches the app and enables the network again. I used the following code:

@echo on

ipconfig /release

"C:\Program Files\RoboHelp Office\RoboHTML\RoboHTML.exe"

ipconfig /renew

So whenever i want to start the app, i double-click the batch file and not the EXE.

Now this works the app gets launched automatically. Though there are two issues:

1. The windows command prompt window does not close after the app is launched.

2. The network does not get enabled. a small yellow triangle displays adjacent to the network icon in the system tray. I then have to enable the network myself.

Can anyone tell me how I can modify this batch file? Or is there any other way of doing this?

Pl. help

Link to comment
Share on other sites


FIrst up ipconfig /release is a command used to release your IP address only. Renew just renews it. It doesn't disable the network. Obviously if you release your IP you won't be able to browse the network, but it doesn't mean it's disabled.

I'm not sure which command will disable your LAN connection but I'll look it up.

Link to comment
Share on other sites

You need to use the Devcon program to enable and disable network connections from the command line. Devcon is listed as a "Command Line Utility Alternative to Device Manager.

The command to enable the connection looked like this:

devcon enable *rc_virtualadapter

And the command to disable the connection looked like this:

devcon disable *rc_virtualadapter

I am not sure how I found out the connections "name" but if you google devcon.exe you should be able to find it.

You can get more information, and download devcon, from microsoft at http://support.microsoft.com/default.aspx?...b;EN-US;Q311272

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...