0

我想从来宾 VM 中获取环境变量的值。VMWare VIX api 声称在他们的 API 中内置了这个功能

帮助readVariable内容如下:

Reads a variable from the virtual machine state or guest.
You can get eitherruntime configuration in the .vmx file,
or environment variables in the guest operating system.
The latter requires a valid guest login.
<path to .vmx file>
[ runtimeConfig |
guestEnv ]
<variable name>

例如,获取用户配置文件:

vmrun -gu myusername -gp myfakepassword readVariable "C:\VMWare-VMs\myusername\myusername-XPSP3-3.vmx" guestEnv %USERPROFILE%

但是……变量的值去哪儿了?

4

1 回答 1

0

USERPROFILE, 不%USERPROFILE%, 有效

于 2012-11-26T05:43:26.073 回答