A
ananda vardhana
Guest
wstring getVM = L"powershell -Command \"& {$TotalVM = Get-VM; $TotalVMCount = $TotalVM.count; echo $TotalVMsCount > VmCount.txt}\" ";
_wsystem(getVM.c_str());
The above 2 lines will work in a C++ code and the contents of VmCount.txt will have the VmCount. Question is how to get the VmCount into my C++ program I have to open the file do a getline() and then convert the string to int. Can I somehow get the value TotalVM.count straigt into my C++ without having to write to a file, open it, read it etc...
Something like int VmCount = $TotalVM.count???. Help will be much appreciated.
thanks
ananda
Continue reading...
_wsystem(getVM.c_str());
The above 2 lines will work in a C++ code and the contents of VmCount.txt will have the VmCount. Question is how to get the VmCount into my C++ program I have to open the file do a getline() and then convert the string to int. Can I somehow get the value TotalVM.count straigt into my C++ without having to write to a file, open it, read it etc...
Something like int VmCount = $TotalVM.count???. Help will be much appreciated.
thanks
ananda
Continue reading...