Solved

Create Desktop Icon that will restart a service in Windows 7

Posted on 2010-09-21
4
682 Views
Last Modified: 2012-05-10
Hello,

We are running OpenVPN on our laptops to connect when out of the office.  Most of the time it works great, but every so often the OpenVPNService needs to be restarted for the connection to be made.

I have created a .bat file with:
Net Stop OpenVPNService
Net Start OpenVPNService

which works great on our WinXP machines.  But in Win7 the script doesn't work unless the .bat file is Run as Administrator.

Now I know that it's super easy to right-click on the icon and choose "Run as Administrator."  Unfortunately the sales reps that will use this icon twice a year will never remember this.

Is there an easy way to make it so the .bat could be double-clicked on and just work?

Thanks,
-John
0
Comment
Question by:nieblertech
[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
  • 2
4 Comments
 
LVL 3

Expert Comment

by:celdridgeMadman
ID: 33731266
You should be able to the the properties of the application (the .bet file in this case) to be required to run as an administrator.
0
 
LVL 3

Accepted Solution

by:
celdridgeMadman earned 375 total points
ID: 33731283
Ah actually, no you can't. Silly windows 7 doesn't allow .bat files to tick the run as administrator tickbox. Maybe if it's just a simple script try using a bat-to-exe converter to have it as a .exe file instead (which you CAN tick run as administrator on). eg, http://download.cnet.com/Bat-To-Exe-Converter/3000-2069_4-10555897.html
0
 
LVL 4

Assisted Solution

by:cmartell
cmartell earned 125 total points
ID: 33731319
The "Run this program as an administrator" check box will be grayed out on the batch file properties but you can make a shortcut to the batch file and then set it on the shortcut's properties,
Right click the shortcut and choose Properties
Select the Shortcut tab
Press the Advanced button
Check "Run this program as an administrator"
0
 
LVL 92

Expert Comment

by:nobus
ID: 33732177
i believe  this is what you look for :  http://www.vistaclues.com/run-a-batch-file-as-an-administrator/
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
IPC$ Password 13 49
SQL profiler 3 51
HP ENVY 7645 printer 5 33
F8 to last known good configuration of system 16 63
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…

734 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