@george1421
Thank you for the answer.
Ok the problem is due to the batch script, which runs as system user, not current user.
i would like to apply this script:
Set csv=\192.168.1.1\myshare\ip.csv
for /f “skip=1 delims=, tokens=1-6” %%a in (%csv%) do (
if “%computername%”==“%%a” (
netsh int ipv4 set address “Ethernet” static %%b %%c %%d
netsh int ipv4 set dnsserver “Ethernet” static %%e
netsh int ipv4 add dnsserver “Ethernet” %%f
)
)
It’s a batch script to change ip address to the pcs.
The “csv” variable contains the network path to point at the .csv file,
where are all pcs names and relative ip address.
When i run the snapin with this script the script doesn’t get ip.csv and doesn’t read the ip.csv file.
the output is:
C:\Program Files (x86)\FOG\tmp>Set csv=\192.168.1.1\myshare\ip.csv
C:\Program Files (x86)\FOG\tmp>for /F “skip=1 delims=, tokens=1-6” %a in (\192.168.1.1\myshare\ip.csv) do (if “ACF-UNDICI” == “%a” (
netsh int ipv4 set address “Ethernet0” static %b %c %d
netsh int ipv4 set dnsserver “Ethernet0” static %e
netsh int ipv4 add dnsserver “Ethernet0” %f
) )
If i copy ip.csv to the the script works “Set csv=c:\ip.csv” !!!
Why doesn’t the script get ip.csv file from network path?
I tried to map a drive with net use command to copy ip.csv to
net use z: \192.168.1.1\myshare
copy z:\ip.csv c:\
but doesn’t work.
Have you any idea to solve this problem?
Sorry if it is off-topic.
thanks you