comando.txt

codice:
winexe -U Administrator%166156147 //nomepc "REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters /v MaxTokenSize /t REG_DWORD /d 65535"
pc.txt

codice:
\\SEDPC085813
\\NOTEBOOK076923
\\SEDPC085787
\\SEDPC045748
\\SEDPC045748


Lancio questo script.

codice:
#!/bin/bash

if [ -f "scriptwinexe.sh" ]
then
	rm "scriptwinexe.sh"
fi

touch scriptwinexe.sh
chmod +x scriptwinexe.sh

linee=$(wc -l pc.txt | cut -d " " -f 1)
i=1

while [ $linee -gt 0 ]; do
	nome=$(head -$i pc.txt | tail -1)
	i=$(($i + 1))
	linee=$(($linee - 1))

	sed -e s/nomepc/$nome/ comando.txt >> scriptwinexe.sh
	echo "" >> scriptwinexe.sh;
done

exit 0

e mi ritrovo questo in scriptwinexe.sh

codice:
winexe -U Administrator%166156147 //\SEDPC085813 "REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters /v MaxTokenSize /t REG_DWORD /d 65535"

winexe -U Administrator%166156147 //\NOTEBOOK076923 "REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters /v MaxTokenSize /t REG_DWORD /d 65535"

winexe -U Administrator%166156147 //\SEDPC085787 "REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters /v MaxTokenSize /t REG_DWORD /d 65535"

winexe -U Administrator%166156147 //\SEDPC045748 "REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters /v MaxTokenSize /t REG_DWORD /d 65535"

winexe -U Administrator%166156147 //\SEDPC045748 "REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters /v MaxTokenSize /t REG_DWORD /d 65535"

il problema che non riesco a risolvere è lo slash in rosso che non dovrebbe esserci //\ SEDPC085813