简体   繁体   中英

How to execute cmd in admin mode using robot framework?

I need to add to the store the certificate

Robot code is

${result} Run Process certutil -addstore "Root" "C:\Users\Desktop\xyz.crt" shell=True

log ${result.stdout}

output is Administrator permissions are needed to use the selected options. Use an administrator command prompt to complete these tasks. CertUtil: The requested operation requires elevation.

So I need to run the process using privileged mode how to achieve it using robot frmaework

Try this assuming only windows

${result} Run Process runas /noprofile /user:<account with admin> <program that needs admin e.g. certutil>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM