Batch file or Powershell script to create a configuration file based on truncated computername

Fullført Lagt ut 6 år siden Betales ved levering
Fullført Betales ved levering

The attached batch file creates a configuration file based on the computer name. I need it modified to edit the computer name variable so that if the name starts with "PC", the name is truncated to 7 characters. Otherwise, it is truncated to 5 characters.

So, PC12345 => PC12345, PC1234567 becomes PC12345, WM123 => WM123, WM123456 becomes WM123

I prefer a solution that does not require Powershell or VB.

Bash Scripting Powershell Scripting Windows skrivebord

Prosjekt-ID: #16628724

Om prosjektet

6 bud Eksternt prosjekt Aktiv 6 år siden

Tildelt til:

AdrianCJ

Hello, I fixed the batch, now it truncates the name based on the computer name. You can have it right away. Thank you :)

$20 USD på 1 dag
(3 omtaler)
1.5

6 frilansere byr i gjennomsnitt $27 for denne jobben

vano101

Hello I would like to investigate for a little, meantime I believe it should be pretty easy project.....

$30 USD på 2 dager
(417 Omtaler)
6.5
AhmadSameer

Hey All you need is to edit the computer name to be 7 characters if it starts with "PC" and to be 5 characters if it starts with anything else? Do you need anything else? I can help

$30 USD på 1 dag
(5 Omtaler)
2.8
dfabretti

Hi there! My name is Douglas and I have been working as an Automation Developer for the last 5 years. I mainly develop using Powershell scripts and I believe that what you need is basically what I do on a daily bas Mer

$25 USD på 1 dag
(5 Omtaler)
3.0
rajputankit26

Hi, Having 9 years of experience in Information technology whoch includes windows and linux as well as network operations management. Have worked on various powershell scripting and schedule windows batch files as wel Mer

$35 USD på 2 dager
(0 Omtaler)
0.0