Coming Soon: GET:IT Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET Coming Soon: GET:IT Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET

Use if FOR loops

Home Forums Scripting DOS Command Shell Use if FOR loops

Viewing 1 post (of 1 total)
  • Author
    Posts

  • LIC
    Member
    #167358

    I have avoided using For loops, as I have a very hard time understanding the mechanics.

    Two part question.
    1. I would like to run a wmic cmd agsinst a list of computers.

    for /f %a in (c:pc.txt) do (wmic bios get serial number)

    the output I get = the number of items in the c:pc.txt file, however the wmic output is from the local pc, not the computers in the txt.

    i have read many sites/ examples, but none help solve the issue.

    Please keep your answers as basic as possible- using one liners.
    Please offer assistance with DOS (do not wish to confuse myself further)

    2. Can you provide a good site that does NOT get so esoteric
    in the usage?

    thanks in advance

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Live Webinar: Active Directory Security: What Needs Immediate Priority!Live on Tuesday, October 12th at 1 PM ET

Attacks on Active Directory are at an all-time high. Companies that are not taking heed are being punished, both monetarily and with loss of production.

In this webinar, you will learn:

  • How to prioritize vulnerability management
  • What attackers are leveraging to breach organizations
  • Where Active Directory security needs immediate attention
  • Overall strategy to secure your environment and keep it secured

Sponsored by: