Share via


Serial Number to Name a Folder dynamically.

Question

Monday, February 18, 2019 3:31 PM

Hi,

I am working with a CMD /Batch file where I have to mention the Directory name.

I am looking for a way to create a folder (Mkdir) with name same as PC Serial Number. And then reference this in batch file ... possible?

mkdir "C:\Same as PC Serial Number"

In batch file Xcopy "C:\Same as PC Serial Number" 

All replies (5)

Monday, February 18, 2019 5:39 PM | 1 vote

You would have to use , 

wmic bios get serialnumber   and then pass that serial as a parmeter

Tuesday, February 19, 2019 3:06 AM

Hi,

 

According to your description, please refer to the following link:

 

WMIC commands to change computer name to BIOS serial number

https://stackoverflow.com/questions/40485627/wmic-commands-to-change-computer-name-to-bios-serial-number

 

Note: This is a third-party link and we do not have any guarantees on this website. And Microsoft does not make any guarantees about the content.

 

Hope these are helpful.

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Tuesday, February 19, 2019 7:58 AM

Hi,

Well, I know that Serial Number can get with WMIC command, 

WMIC BIOS GET SERIALNUMBER

My question was to create a folder with the name equals to serial number (the articles are renaming PC to serial number instead).


Tuesday, February 19, 2019 7:50 PM

Hello,

Here is a thread where you can capture the serialnumber as a variable

https://social.technet.microsoft.com/Forums/windows/en-US/764e733d-98b9-49ae-aa73-66629f6a5aad/how-can-i-set-the-computer-serial-number-as-a-variable

You should be able to use the variable to create the folder can and with xcopy.

Thanks, Darrell Gorter [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.


Tuesday, March 5, 2019 9:43 AM

Hi,

Was your issue solved?

If yes, would you like to share your solution in order that other community members could find the helpful reply quickly.

If no, please reply and tell us the current situation in order to provide further help.

Best

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].