%%A not translating as variable
Posted: 02 Jun 2011 06:33
Hi ,
I'm struggling to get a batch file to run against a list of hostnames
heres some code where the issue occurs
@echo on
for /f %%A in (C:\hosts.txt) do
xcopy /herky "C:\BUILDS\TMA HHDC Applications\ConsumptionAdministrator-2.0.5.msi" "\\%%a\C$\Temp"
and here is the error
C:\WINDOWS\system32>xcopy /herky "C:\BUILDS\TMA HHDC Applications\ConsumptionAdm
inistrator-2.0.5.msi" "\\%a\C$\Temp"
Invalid drive specification
0 File(s) copied
As you can see the %%A doesn't bring the computer name listed in the hosts.txt file, where I would expect \\PCNAMEEG\C$\Temp Im getting %A as the pcname and thus the fail. I have played around with different things but cant get to the bottom of it?
Any tips would be great...thanks.
I'm struggling to get a batch file to run against a list of hostnames
heres some code where the issue occurs
@echo on
for /f %%A in (C:\hosts.txt) do
xcopy /herky "C:\BUILDS\TMA HHDC Applications\ConsumptionAdministrator-2.0.5.msi" "\\%%a\C$\Temp"
and here is the error
C:\WINDOWS\system32>xcopy /herky "C:\BUILDS\TMA HHDC Applications\ConsumptionAdm
inistrator-2.0.5.msi" "\\%a\C$\Temp"
Invalid drive specification
0 File(s) copied
As you can see the %%A doesn't bring the computer name listed in the hosts.txt file, where I would expect \\PCNAMEEG\C$\Temp Im getting %A as the pcname and thus the fail. I have played around with different things but cant get to the bottom of it?
Any tips would be great...thanks.