Announcement

Collapse
No announcement yet.

PSEXEC and NETSH

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PSEXEC and NETSH

    I'm trying to change DNS entries and orders on multiple servers. Below is my syntax.

    psexec \\%e% -u myuser -p mypassword -f changedns.bat

    Here is what changedns.bat says, and it is in my path:

    @echo on
    netsh interface ip delete dns name="Local Area Connection" addr=all

    netsh interface ip add dns "local area connection" addr=172.24.20.56 index=1

    netsh interface ip add dns "local area connection" addr=172.16.1.25 index=2
    pause

    without the spaces and line wrap.

    When I execute it, I get a script window that launches and disappears. Any ideas?

    Thanks in advance.

  • #2
    Re: PSEXEC and NETSH

    Try putting cmd /c in front of it like:

    cmd /c psexec \\%e% -u myuser -p mypassword -f changedns.bat

    Comment


    • #3
      Re: PSEXEC and NETSH

      Just a suggestion I found that helps. While testing, use /K instead of /C so the command window stays open after the script finishes so you can see any errors generated.

      Comment

      Working...
      X