Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

Windows scripting commands not executing in guest customization's "Run Once" feature.

$
0
0

I’m executing a couple Windows scripting commands in the Run Once section of guest customization for a WIN2K8 VM, but it appears vSphere is not parsing it correctly, because there’s no sign of the commands having executed properly. However, it executes perfectly fine at the Windows command prompt. For reference, I've included the script below, albeit with IPs and variables modified.

 

 

set "C_ALIAS=netsh interface ipv4 set" && for /f "delims=" %a in ('netsh interface ipv4 dump ^| find "1.1.1.1"') do @set NIC_C=%a && call %C_ALIAS% %NIC_C:~4% metric=200


 

 

set "M_ALIAS=netsh interface ipv4 set" && for /f "delims=" %a in ('netsh interface ipv4 dump ^| find "2.2.2.1"') do @set NIC_M=%a && call %M_ALIAS% %NIC_M:~4% metric=500


 

One hunch I had was that the quotation marks included in the actual command were problematic, because vSphere encloses the entire command in quotation marks. Is this a valid assumption, and if so, does some sort of interrupt character need to be added for it to be parsed correctly?

 

 

If not, does anyone have any hunches as to why the above script is not executing properly? I would appreciate any assistance.


Viewing all articles
Browse latest Browse all 175326

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>