0

I am trying to get a batch file to output some data to a CSV file. The command I have works perfectly in the command line but not when I copy it to a batch file. In the batch file, it just hangs and keeps looping.

Here is the command:

getmac /fo csv /nh >> C:\Users\ohje1001tech\Desktop\test.csv

What I am trying to do is run this script on all the new lab computers that we have and generate a list of mac addresses that we can use to reserve IPs in the DHCP server.

Ideally I would like the computer name as well but thats not really needed.

3
  • 1
    What does your batch file actually look like? Is it just this one line? Also - what version of windows are you running this on?
    – Rex
    Mar 11, 2014 at 15:08
  • Yes, it is just the one line. Am I missing some syntax? I am running win 7 pro. Mar 11, 2014 at 15:20
  • Having just this line in a batch file will not loop. It might hang if something goes wrong, but there is no technical way for it to loop unless you are calling this batch file from something else.
    – Rex
    Mar 11, 2014 at 15:23

1 Answer 1

1

Make certain your batch file is not called "getmac.bat" or "getmac.cmd" -- it is probably making a recursive call to itself.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .