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

已完成 已发布的 6 年前 货到付款
已完成 货到付款

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 视窗桌面

项目ID: #16628724

关于项目

6个方案 远程项目 活跃的6 年前

授予:

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 在1天内
(3条评论)
1.5

有6名威客正在参与此工作的竞标,均价$27/小时

vano101

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

$30 USD 在2天内
(417条评论)
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

$30USD 在1天里
(5条评论)
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 更多

$25USD 在1天里
(5条评论)
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 更多

$35 USD 在2天内
(0条评论)
0.0