I can't figure out what's going wrong here. I am trying to just run a simple batch file that will write the machines IP to a folder with a filename of %computername%.txt.
The command works if I type it in to a command prompt, but when I run it as a batch file, the command gets altered and does not work. I don't know if my knowledge of batch files is to blame or my knowledge of netsh, neither of which is great.
Anyway, here is the command:
And here is what shows up in the command window:
Why does the bracket get a 1 before and a space delete after? I have tried escaping the bracket with ^> but it didn't work.
What simple thing am I missing?
The command works if I type it in to a command prompt, but when I run it as a batch file, the command gets altered and does not work. I don't know if my knowledge of batch files is to blame or my knowledge of netsh, neither of which is great.
Anyway, here is the command:
Code:
net use W: \\10.11.115.230\config\IPLogs pass /user:user
netsh interface ip show addresses > W:\%computername%.txt
And here is what shows up in the command window:
Code:
net use W: \\10.11.115.230\config\IPLogs pass /user:user
netsh interface ip show addresses 1>W:\configserver.txt
Why does the bracket get a 1 before and a space delete after? I have tried escaping the bracket with ^> but it didn't work.
What simple thing am I missing?
