Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 09-08-2014, 03:45 PM   #1
Fully Optimized
 
MooseMan's Avatar
 
Join Date: Nov 2005
Location: United States
Posts: 2,627
Send a message via AIM to MooseMan
Question Creating a Script to Automatically Generate Computer Name

Hello everyone,

The company I work for uses almost exclusively Dell computers which have service tags as serial numbers. We have been incorporating the service tags into our computer names since I started here in 2011. We have gotten big enough to where I am working on an automated deployment solution so that we don't have to touch every system that we deploy.

What I am hoping to accomplish is to enable the system to automatically create a computer name that includes Dell's Service tag. We use the naming convention COMPUTERTYPE-LOCATION-SERVICETAG (for example, DST-VA-HJ631R1) for a desktop in Virginia with a Dell service tag of HJ631R1. I know that the service tag can be pulled from the BIOS using the command:

Quote:
wmic bios get serialnumber
However, I have no idea how to take that information and put it into a txt file or something that I could point Sysprep to use for the system name. Could anyone assist in explaining how I could make this happen, preferably with code?

Thanks in advance, and feel free to ask for more information!
__________________

__________________
.::The top folder on the CF F@H team::.
http://fah-web.stanford.edu/cgi-bin/...&teamnum=42655
MooseMan is offline   Reply With Quote
Old 11-14-2014, 05:17 AM   #2
Fully Optimized
 
Draygoes's Avatar
 
Join Date: Nov 2014
Location: United States
Posts: 1,653
Default Re: Creating a Script to Automatically Generate Computer Name

I know this thread is a few months old, but just in case you are still around, or anyone else needs it, this will do the trick...
Quote:
@Echo off
SET SNFile=SN.txt
call :Logit >> %SNFile%
exit /b 0

:Logit
wmic bios get serialnumber
::
Copy exactly as is.
Outputs to SN.txt
__________________

__________________
Will have a youtube channel up soon. Link will be here if I remember.
Draygoes is offline   Reply With Quote
Old 11-14-2014, 09:14 AM   #3
Site Team
 
celegorm's Avatar
 
Join Date: Sep 2006
Posts: 10,713
Send a message via AIM to celegorm
Default Re: Creating a Script to Automatically Generate Computer Name

Quote:
Originally Posted by Draygoes View Post
I know this thread is a few months old, but just in case you are still around, or anyone else needs it, this will do the trick...


Copy exactly as is.
Outputs to SN.txt
Why not just call "wmic bios get serialnumber >> SN.txt"? Same effect, less typing
__________________
"as a fanboy i refuse to admit it and will pull countless things out of my butt to disprove it"

Team Thelegorm! Total Kills: 21 (i iz in uor profile, editsing your sigz)
celegorm is offline   Reply With Quote
Old 11-14-2014, 09:53 AM   #4
Fully Optimized
 
Draygoes's Avatar
 
Join Date: Nov 2014
Location: United States
Posts: 1,653
Default Re: Creating a Script to Automatically Generate Computer Name

Quote:
Originally Posted by celegorm View Post
Why not just call "wmic bios get serialnumber >> SN.txt"? Same effect, less typing
Good point, I should have taken the shorter path.
In this case, I have not gone to bed in a while, so I simply copied from a script that I had written a while ago.
The other script grabs input from several commands, and is designed to be as simple to modify as just inputting or removing commands.
__________________
Will have a youtube channel up soon. Link will be here if I remember.
Draygoes is offline   Reply With Quote
Old 11-17-2014, 01:27 PM   #5
Fully Optimized
 
MooseMan's Avatar
 
Join Date: Nov 2005
Location: United States
Posts: 2,627
Send a message via AIM to MooseMan
Default Re: Creating a Script to Automatically Generate Computer Name

Draygoes,

Many thanks for the reply! I'm glad you didn't overlook it because of its date I am working on imaging laptops and need to use their service tags (listed as serial numbers in the BIOS) for the computer names. I am using a product from Symantec (Deployment Solutions) that helps with imaging and may have a different solution, but this may provide a helpful backup/alternative
__________________
.::The top folder on the CF F@H team::.
http://fah-web.stanford.edu/cgi-bin/...&teamnum=42655
MooseMan is offline   Reply With Quote
Old 11-17-2014, 09:24 PM   #6
Fully Optimized
 
Draygoes's Avatar
 
Join Date: Nov 2014
Location: United States
Posts: 1,653
Default Re: Creating a Script to Automatically Generate Computer Name

Not a problem friend, I am glad to help.
__________________
Will have a youtube channel up soon. Link will be here if I remember.
Draygoes is offline   Reply With Quote
Old 11-18-2014, 02:04 AM   #7
Fully Optimized
 
Draygoes's Avatar
 
Join Date: Nov 2014
Location: United States
Posts: 1,653
Default Re: Creating a Script to Automatically Generate Computer Name

Oh, and I am not sure why, but I cannot stop laughing at your Avatar. Nice choice!
__________________

__________________
Will have a youtube channel up soon. Link will be here if I remember.
Draygoes is offline   Reply With Quote
Reply

Tags
dell, deployment, service tag, sysprep, windows 7

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 12:24 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0