Solved

bat to install an exe file

Posted on 2011-03-04
12
652 Views
Last Modified: 2012-05-11
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
Comment
Question by:WellingtonIS
  • 6
  • 5
12 Comments
 
LVL 11

Expert Comment

by:Kruno Džoić
ID: 35039578
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
 
LVL 3

Expert Comment

by:Frank_Alphaserveit
ID: 35039608
what OS is this machine running?
0
 

Author Comment

by:WellingtonIS
ID: 35039660
OK I'll try the Psexec.  Thanks.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:WellingtonIS
ID: 35039663
The OS is windows XP pro
0
 
LVL 3

Expert Comment

by:Frank_Alphaserveit
ID: 35039691
you can include the "runas" command in the bat file

"runas /user:domain\username"
0
 

Author Comment

by:WellingtonIS
ID: 35039720
so do "runas /user:domain\username"  where is the password
Then run Start c:\...
0
 
LVL 3

Expert Comment

by:Frank_Alphaserveit
ID: 35039736
sorry

"runas /user:domain\username password"
0
 
LVL 3

Accepted Solution

by:
Frank_Alphaserveit earned 500 total points
ID: 35039744
in total it would be

"
runas /user:domain\username password
xcopy /y fileformatconverters.exe "c:\:"
start c:\fileformatconverters.exe /passive.
"
0
 

Author Comment

by:WellingtonIS
ID: 35039770
ok one more question:
runas /user:wellington\administrator password?
0
 
LVL 3

Expert Comment

by:Frank_Alphaserveit
ID: 35039817
yes, replace "password" with the administrator password
0
 

Author Closing Comment

by:WellingtonIS
ID: 35039839
I had to put a : between the administrator and the password but it worked. Thanks!  You saved me so much time.
0
 
LVL 3

Expert Comment

by:Frank_Alphaserveit
ID: 35039852
bah, i knew i forgot something:)

glad it worked out!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Batch File - Count Down 4 70
Reading registry key from HKCU and not hklm 10 106
robocopy vs xcopy vs copy 8 110
how to  skip files that were already there? 3 46
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 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