Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 668
  • Last Modified:

bat to install an exe file

I'm trying to install fileformatconverters.exe via a bat file.  I need to do this with administrator rights.

So far I have
xcopy /y fileformatconverters.exe "c:\:"
start c:\fileformatconverters.exe /passive.  

It will not install unless the machine is logged in as administrator.  Can I get around this?
0
WellingtonIS
Asked:
WellingtonIS
  • 6
  • 5
1 Solution
 
Kruno DžoićSystem EngineerCommented:
start bat file with RunAs tool

or

You can use psexec tools ( free ) and start bat remotely from another computer

fileformat.bat - example, add in environment path

psexec \\computerIP_address -u Administrator -p password fileformat.bat
0
 
Frank_AlphaserveitCommented:
what OS is this machine running?
0
 
WellingtonISAuthor Commented:
OK I'll try the Psexec.  Thanks.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
WellingtonISAuthor Commented:
The OS is windows XP pro
0
 
Frank_AlphaserveitCommented:
you can include the "runas" command in the bat file

"runas /user:domain\username"
0
 
WellingtonISAuthor Commented:
so do "runas /user:domain\username"  where is the password
Then run Start c:\...
0
 
Frank_AlphaserveitCommented:
sorry

"runas /user:domain\username password"
0
 
Frank_AlphaserveitCommented:
in total it would be

"
runas /user:domain\username password
xcopy /y fileformatconverters.exe "c:\:"
start c:\fileformatconverters.exe /passive.
"
0
 
WellingtonISAuthor Commented:
ok one more question:
runas /user:wellington\administrator password?
0
 
Frank_AlphaserveitCommented:
yes, replace "password" with the administrator password
0
 
WellingtonISAuthor Commented:
I had to put a : between the administrator and the password but it worked. Thanks!  You saved me so much time.
0
 
Frank_AlphaserveitCommented:
bah, i knew i forgot something:)

glad it worked out!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now