Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get hard disk serial number with php on localhost

is there a way i can get hard disk serial number or machine serial number with php or javascript on localhost ??

we can get it with following command in cmd

wmic DISKDRIVE GET SerialNumber

or machine serial number by this

wmic bios get serialnumber

is that possible with php or javascript ?? something in php

<?php

echo DISKDRIVE GET SerialNumber //** some thing like this on local host

?>

Need is to give a project to Clint on local host, and i want no one to access it on other computer (in php)

like image 386
Harinder Avatar asked Jan 15 '23 19:01

Harinder


1 Answers

You can of course use

shell_exec('wmic DISKDRIVE GET SerialNumber 2>&1')

or

shell_exec('wmic bios get serialnumber 2>&1') 

if wmic is installed on server and your PHP has permission to run it.

The '2>&1' part is used from the suggestion here.

like image 99
Lenin Avatar answered Jan 29 '23 21:01

Lenin