how to make a .bat file to give open a file a

September 24, 2011 at 03:34:12
Specs: Windows 7
I want to know how to code for creating such a batch file to run a program, rather say Command prompt with administration privileges...

Thanx in advance


See More: how to make a .bat file to give open a file a

Report •

#1
September 24, 2011 at 06:59:11
Create a text file pgm.txt (or xxx.txt)

Type in

@start "C:\Program Files\DVD Maker\DVDMaker.exe"

Save the file and change the extension to cmd (or .bat, they are the same) such as pgm.cmd or xxx.cmd (or xxx.bat). This command starts a program named DVDMaker in Program Files\DVD Maker directory.

In general, the command can be written as

@start "<path of the program>"

Right-click pgm.cmd and click Properties. Go to Compatibility tab and put a checkmark in the square box next to Run this program as administrator.

If you want to execute several commands in series but want to wait until one program finishes, then you write @start /w. w is for wait.

@start /w "<path of the program>"

You can run a program in High Priority if you type in

@start /high "C:\Program Files\..."

or Low Priority @start /low ...

The options as to Priority are realtime, high, normal, low.

Be careful when you want to use realtime. You cannot do other things.

CoolGuy


Report •

#2
September 24, 2011 at 10:02:12
Search for runas with elevated permission

1/3 of highway deaths are caused by drunks. The rest are by people who can't drive any better than a drunk.


Report •
Related Solutions


Ask Question