PC Review


Reply
Thread Tools Rate Thread

%computername% variable wildcards

 
 
New Member
Join Date: Nov 2010
Posts: 2
 
      21st Nov 2010
I'm trying to create a script that will output the last 5 digits of the computer name and set them as the asset tag of the computer, so far i have this

Echo %computername% >> tag.txt // outputs the computer name (SEL-45675) to a text file named tag.txt

biosconfigutility.exe /setconfig:tag.txt // uses the hp utility to load the configuration from the tag.txt file.

My issue is that the tag can't have the first 4 characters, so i need to supress the SEL- part from the tag.txt file



i know that "%Compuername:~0,5%" will make the out be only the first 5 characters which is the opposite of what i'm trying to do.
 
Reply With Quote
 
 
 
 
New Member
Join Date: Nov 2010
Posts: 2
 
      22nd Nov 2010
I figured it out

echo %computername:~-5%
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get Computername in VBA? Dave Reardon Microsoft Access 6 11th Mar 2009 11:21 PM
wds + computername Rob Mokkink Windows Vista Installation 0 1st Dec 2007 06:47 PM
See my computername? JimmyJam Windows XP New Users 2 21st Aug 2005 05:27 PM
Can't use \\computername\c$ Scotty44 Microsoft Windows 2000 Networking 4 12th Aug 2004 09:25 AM
can asp.net get the computername? Jason Shohet Microsoft ASP .NET 1 15th Jan 2004 09:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:18 AM.