# Run software as administrator through the command prompt



## xionhack (Oct 12, 2010)

Hello. I'm going to explain my whole case that way you can tell me what would be the best solution.


I have a .exe application that I want to install in about 500 computers. We have windows server 2003 in our servers. We dont have SMS and cannot afford it. I tried making the file an msi but it didnt work. 


The file has command prompt options, so I can install it using commands through cmd. The way I was thinking about doing it was by making a script and put it in group policy, that would download the file to a temp folder and then would install it through the command prompt; the problem is that none of those computers have admin rights so they wont be able to install it.


I want to know if there is a way for me to install as admin through the command prompt by putting the info in the script or in another way. Please let me know how you think its best. We cannot really spend money in this, our other option would be to go computer by computer and install it. Thank you.


----------



## peterh40 (Apr 15, 2007)

You can use Group Policy and use Startup scripts which run at startup, you could use the script to 'install' the program (it will run as SYSTEM).

MSIs are fairly easy to make, why did your MSI build fail?


----------



## xionhack (Oct 12, 2010)

Would there be a problem if two computers try to access the file at the same time? Or if one computer wants to download the file while the other one is downloading it?

I dont know why the msi failed. It ran in my computer but the guy that tried to deploy it said that it didnt work


----------



## xionhack (Oct 12, 2010)

Here is the script, Im having a problem with it, I dont want it to install the program if it was installed before, maybe checking if the file was downloaded into the TEMP fiolder:


@echo off

echo ### Creating TEMP directory...
mkdir "C:\TEMP"


echo ### Downloading Software Manager
echo n|copy /-y "\\serverNETLOGON\setupInstall.exe" "C:\TEMP"


echo ### Installing Software manager
C:\TEMP\setupInstall.exe -server setup.server2.com -quiet


----------



## gfne (Oct 28, 2010)

You may need to prerequisite the installation command with a runas statement to runas administrator (if needbe.)

To check if the file has already been copied to the c:\temp folder you could do something like this:
if exist c:\temp\filename.ext goto end

and at the end of the file insert this:
:end


----------

