Computing.Net > Forums > Programming > Create file with mac address

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Create file with mac address

Reply to Message Icon

Name: atlantisguard
Date: March 6, 2004 at 06:17:04 Pacific
OS: DOS
CPU/Ram: PIII
Comment:

Can someone help me?

This is the problem:

I have a networkboot disk, when i use the disk for the first time on a computer, then the batchprogram must determine the macaddress, look if a file with the mac address of this computer already exist on a network share. If not exist, call format.bat and create a file with the mac address as name on the network share. If exist, goto unattended installation.
I try several options in batch file but i cannot give de file the name of a variable.

Much thanks to the person with a solution.

GRT

Example: (incorrect syntax)
set preload=z:

:getMac
Get mac adress.
??? nbmac.exe > %macaddress%

if not exist "%preload%.\winxp\boot\%macaddress%" goto Format
call unattented.bat
goto end

:Format
call format.bat
REM Create file with macaddress name
???????
goto end

:end
ECHO Einde

Atlantisguard



Sponsored Link
Ads by Google

Response Number 1
Name: CyberSlug
Date: March 7, 2004 at 22:26:15 Pacific
Reply:

The easy part is creating the file.
REM Creates 0-byte file with macaddress as name
type nul > %macaddress%

The hard part is getting the mac address into a variable. Maybe try
nbmac.exe > result1.dat
And then try example #39 here. Also look at #47.

Good Luck

P.S. I highly recommend looking at a more flexible scripting language such as AutoIt.


0
Reply to Message Icon

Related Posts

See More


C/C++ Question Error when i trying insta...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Create file with mac address

PERL create files w/ variable names www.computing.net/answers/programming/perl-create-files-w-variable-names/16666.html

VB6 - get MAC address www.computing.net/answers/programming/vb6-get-mac-address/7961.html

MAC address delphi www.computing.net/answers/programming/mac-address-delphi/4571.html