Variable Help

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
xen__
Posts: 2
Joined: 17 Dec 2013 01:49

Variable Help

#1 Post by xen__ » 17 Dec 2013 01:56

Hello,

i need a Script that to
grab %computername% and "save" the 5 first sign.
Put the save variable and add a name like s01.
I know the option ~,5


if /i %computername:~0,6%==PCNAME goto PCNAME1

:PCNAME1
set "%computername%=%Quelle:~,3%"

i dont know how to script it. Have anyone a idea?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Variable Help

#2 Post by foxidrive » 17 Dec 2013 02:24

Code: Select all

set newname=%computername:~0,5%s01
echo "%newname%"

xen__
Posts: 2
Joined: 17 Dec 2013 01:49

Re: Variable Help

#3 Post by xen__ » 17 Dec 2013 02:29

Tahnks. It works like a charm :D

Post Reply