& was unexpected at this time

خرید بک لینک

I have a batch file that is supposed to set some variables at the beginning.

for /f %%A in ('wmic os get osarchitecture ^| find /i "bit"') do set "OSARCH=%%A"
for /f "skip=1 tokens=4" %%B in ('wmic product where "name like 'Microsoft .NET%'" get name') do set "DNVER=%%B"
for /f "tokens=3" %%C in ('reg query "HKLMSOFTWAREMicrosoftInteet Explorer" /v svcVersion' do set "IEFULLVER=%%C"
set IEVER=%IEFULLVER:~0,4%

If I run these in CMD prompt, (substituting %%A for %A etc), they work as expected, but when I run the batch file, the first line runs as expected and then I get an & was unexpected at this time error. I'm thinking it might be to do with the % after .NET, but it has to be there otherwise the wmi query won't retu the value I need.

Any help will be greatly appreciated.

Mark

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 207 تاريخ: شنبه 29 خرداد 1395 ساعت: 16:36

صفحه بندی