Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need Script to copy data based on MAC address

Featured Replies

My goal is to query the MAC of the PC's network card and then look it up in a simple text database file in the format of:

MAC,PCName,ProductKey,Path on each line.

Once it finds the MAC in the file 'mac.txt' it should Display the PC Name, Product Key and Path on the screen just for confirmation, then it should change the PC Name, and copy contents from the path specified to C:\ABR and finally run an .exe file in the C:\ABR folder.

Here's a sample of proposed mac.txt:

"00-E0-B8-80-59-06",PCLAB-01,CXXXT-988V6-GXXXX-8HP7R-H4KK3,%WINDIR%/Activation/PCLAB01
"00-E0-B8-80-58-B6",PCLAB-02,W8HKH-4XXXX-HVRFD-GXXXX-2XXVG,%WINDIR%/Activation/PCLAB02
"00-E0-B8-80-58-41",PCLAB-03,DXXXF-78W4P-V8CBY-TXXX9-QX6QW,%WINDIR%/Activation/PCLAB03
"00-E0-B8-80-58-AF",PCLAB-04,RDM42-GK4BV-X72YB-RQXP3-RXDJJ,%WINDIR%/Activation/PCLAB04
"00-E0-B8-80-57-15",PCLAB-05,TXQ6B-3XXXX-Y6RXP-YTGGW-QXXX3,%WINDIR%/Activation/PCLAB05
"00-E0-B8-80-58-0B",PCLAB-06,XXXXP-XXX8W-MXXXX-H99R7-XXX9D,%WINDIR%/Activation/PCLAB06

Here's my partial script that needs refining and the part to rename the PC and copy files...

ECHO Determining Machine Name and Product Key...
ECHO.
ping -n 3 localhost> NUL
For /f "usebackq delims=," %%i IN (`getmac /fo csv /nh`) do (
For /f "usebackq delims=, tokens=1-3" %%a IN (`type mac.txt`) DO If %%i EQU %%a (
Set strComputername=%%b
Set strProduct=%%c
Set strPath=%%d
) )
Echo Computer Name should be: %strComputername%
ping -n 2 localhost> NUL
Echo Product Key should be: %strProduct%
ECHO.
Echo Path to Activation files should be: %strPath%

Any help would be appreciated!

  • Author

Nevermind, I figured it out, I just had to think it through. But just in case this is usefull to anyone, here's the code:

@echo off && Mode 80,25 && Color F2
TITLE OEM Activation
ECHO.
ECHO Determining Machine Name and Product Key...
ECHO.
ping -n 3 localhost> NUL
For /f "usebackq delims=," %%i IN (`getmac /fo csv /nh`) do (
For /f "usebackq delims=, tokens=1-3" %%a IN (`type mac.txt`) DO If %%i EQU %%a (
Set strComputername=%%b
Set strProduct=%%c
) )
ping -n 3 localhost> NUL
Echo Computer Name should be: %strComputername%
ping -n 3 localhost> NUL
Echo Product Key should be: %strProduct%
ping -n 3 localhost> NUL
Echo Path to Activation files should be: C:\Windows\Activation\%strComputername%
Echo.
ping -n 3 localhost> NUL
Echo Activating Windows...
Echo.
copy c:\windows\Activation\%strComputername%\*.* c:\Windows\Activation\ /y
start /wait C:\Windows\Activation\activation_restore.exe --silent
ECHO Windows should now be OEM Activated!
Echo.
ping -n 4 localhost> NUL
EXIT

Of course you need a lookup table file called mac.txt in the format:

"00-E0-B8-80-59-06",PCLAB-01,CXXXT-988V6-GXXXX-8HP7R-H4KK3

" MAC ID ", PC Name , Product Key

And you should have a folder in Windows called 'activation' containing subfolders with each computer's name. These subfolders should contain the OEM activations files (backup-cert.xrm-ms, backup-key.txt) from the respective computer. The root folder (Activation) should have the 'activation_restore.exe' file. By the way, the activation routine here is specifically for Vista OEM edition.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.