|27 Oct 2011||#1|
| || |
I am trying to run/create a batch script for the users on my domain to install a program that will download and update flash and java. I have the .exe stored on the network share and currently have most of the script written. The part where i need help is to have to .exe run as one of our network administrators. Below is the code I have, where/how do I tell it to run as domain.local\networkadmin plus the account's password.
copy \\toohey\CareCloud\CCFlash.exe C:\CCFlash
START C:\CCFlash\CCFlash.exe /silent S:\IT\CCFlashReports\reports.txt /repair
All help is appreciated.
EDIT: This script will run on XP Pro and Windows 7 Pro machines. 32 and 64 bit.
|My System Specs|
|27 Oct 2011||#2|
| || |
Take a look at the runas command, it should give you what you need
RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]
RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]
/smartcard [/user:<UserName>] program
RUNAS /trustlevel:<TrustLevel> program
/noprofile specifies that the user's profile should not be loaded.
This causes the application to load more quickly, but
can cause some applications to malfunction.
/profile specifies that the user's profile should be loaded.
This is the default.
/env to use current environment instead of user's.
/netonly use if the credentials specified are for remote
/savecred to use credentials previously saved by the user.
This option is not available on Windows 7 Home or Windows 7
and will be ignored.
/smartcard use if the credentials are to be supplied from a
/user <UserName> should be in form USER@DOMAIN or DOMAIN\USER
/showtrustlevels displays the trust levels that can be used as arguments
/trustlevel <Level> should be one of levels enumerated
program command line for EXE. See below for examples
> runas /noprofile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:email@example.com "notepad \"my file.txt\""
NOTE: Enter user's password only when prompted.
NOTE: /profile is not compatible with /netonly.
NOTE: /savecred is not compatible with /smartcard.
|My System Specs|
|Similar help and support threads for2: Batch Scripts|
|How to run a batch file at logoff & some batch scripting help please||Backup and Restore|
|IE9 prompts to run scripts or activex||Browsers & Mail|
|Two Scripts: START then END Application||General Discussion|
|Windows Startup scripts.. exactly when?||General Discussion|
|User scripts||Browsers & Mail|
|message about scripts on bootup?||General Discussion|
|Our Sites ||Site Links ||About Us ||Find Us |
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
All times are GMT -5. The time now is 01:24 PM.