1.

Solve : store xml markup as a var...?

Answer»

Hey,

I am not very experience with Batch scripting.

What I WANT to do is store  a xml file, (which is a result of a export from netsh) and store it as a variable.

I want to create the xml file on another computers %temp% folder and run netsh import, then delete the file.

This hasn't been working for me. I've HIGHLIGHTED the xml.

Quote

echo off
var xmlcontect= <?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
   <name>NETGEAR</name>
   <SSIDConfig>
      <SSID>
         <hex>4E455447454152</hex>
         <name>NETGEAR</name>
      </SSID>
      <nonBroadcast>false</nonBroadcast>
   </SSIDConfig>
   <connectionType>ESS</connectionType>
   <connectionMode>auto</connectionMode>
   <autoSwitch>TRUE</autoSwitch>
   <MSM>
      <security>
         <authEncryption>
            <authentication>shared</authentication>
            <encryption>WEP</encryption>
            <useOneX>false</useOneX>
         </authEncryption>
         <sharedKey>
            <keyType>networkKey</keyType>
            <protected>true</protected>
            <keyMaterial>01000000D08C9DDF0115D1118C7A00C04FC297E B01000000A9CCD0C3AF3D9B408C3844D92C63BD 278000000002088000000003660000A80000001 0000000EB34D699AFE53210DA74B177A8F16C77 0000000004800000A0000000100000001281B80 A3F56BE1B8FF0104FB320C7908000000F4120C6 EE4A560461400000876D1BA154CFF7117A5587D 43EC154AC3DAA81B7B</keyMaterial>
         </sharedKey>
      </security>
   </MSM>
</WLANProfile>
>> %TEMP%\Wireless Network Connection-NETGEAR.xml


netsh wlan add profile filename=”%TEMP%\Wireless Network Connection-NETGEAR.xml”

del /f %TEMP%\Wireless Network Connection-NETGEAR.xml

Code: [Select]echo off
more /e +6 "%~f0">"%TEMP%\Wireless Network Connection-NETGEAR.xml"
netsh wlan add profile filename=”%TEMP%\Wireless Network Connection-NETGEAR.xml”
del /f "%TEMP%\Wireless Network Connection-NETGEAR.xml"
goto :eof

<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
   <name>NETGEAR</name>
   <SSIDConfig>
      <SSID>
         <hex>4E455447454152</hex>
         <name>NETGEAR</name>
      </SSID>
      <nonBroadcast>false</nonBroadcast>
   </SSIDConfig>
   <connectionType>ESS</connectionType>
   <connectionMode>auto</connectionMode>
   <autoSwitch>true</autoSwitch>
   <MSM>
      <security>
         <authEncryption>
            <authentication>shared</authentication>
            <encryption>WEP</encryption>
            <useOneX>false</useOneX>
         </authEncryption>
         <sharedKey>
            <keyType>networkKey</keyType>
            <protected>true</protected>
            <keyMaterial>01000000D08C9DDF0115D1118C7A00C04FC297E B01000000A9CCD0C3AF3D9B408C3844D92C63BD 278000000002088000000003660000A80000001 0000000EB34D699AFE53210DA74B177A8F16C77 0000000004800000A0000000100000001281B80 A3F56BE1B8FF0104FB320C7908000000F4120C6 EE4A560461400000876D1BA154CFF7117A5587D 43EC154AC3DAA81B7B</keyMaterial>
         </sharedKey>
      </security>
   </MSM>
</WLANProfile>


Discussion

No Comment Found