1.

Solve : catch an answer then get MAC?

Answer»

Hello all, it's been a few years...

So, here's what I want to do :
Code: [Select]echo off
echo.
echo What is the name of the computer
(catch the computer name) >> ~%dp0\1.txt
getmac >> ~%dp0\1.txt
exit

The thing is that I don't know how to "catch" the answer.
My best guess is that there's a %1 somewhere to catch it...

Any help ?
ThanksDid you mean this 
Code: [Select]echo %ComputerName%If you really want USER input, that is done with the SET /P command.  You can read the help for the SET command by opening a command prompt and TYPING: set /?Hackoo, no, this gives me the computername already defined. This would be executed in a WinPE boot. So I can get the computername defined by the compagny, on the tag. Like it's not even built (imaged) yet !
Suashman, so :
Code: [Select]echo off
echo.
set /p "input="Please enter the computer name and press Enter"
echo %input% >> ~%dp0\1.txt
getmac >> ~%dp0\1.txt
exit

then, I would have the result of "Input" in the txt file?Sry, I can't edit the previous post...

So, tested and corrected some of my mistakes :
1. It's %~dp0, and not ~%...

The "getmac% gives me a lot of info... too much in fact :
Code: [Select]Adresse physique    Nom DU transport                                         
=================== ==========================================================
AA-BB-CC-DD-EE-FF   N/A 

is it possible to have "only" the mac address ?       I've passed some switches to the getmac, it RUNS good in a windows installed machine... But I want to run it from a PE Environment

Code: [Select]getmac /fo table /nh



Discussion

No Comment Found