Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help ! .. Change pc name automatic from txt

Featured Replies

Dear readers,

Sorry for my english but i am trying to do my best :blushing:

I need a VB script or Batch script that does the following thing :

I want that the computername changed automatic, and i hope that it is possible that the names read from a list from a txt file,

Sample :

If name exist then next

pc01-3-brin

if exist then

pc02-3-brin

pc01-3-brin not exist then it's the new computer name

I hope you will understeand me,

Thank you guy's

What do you mean by "if exist xxxx" if the name already exists on the network? or if it is in the text file?

If it is that it is on the network this will only work if all the machines are on, otherwise you won;t be able to know if MachineNameX exists.

It would be better if you have a DHCP server that you can query against to get the registered machine name and rename it according to that, or associate something with the machine to the machine name like a serial number that could be looked up with WMI.

  • 3 weeks later...

If you want to see if the machine is live on the network you could do as IceManND suggests and query a DHCP server or ping the list of servers in your batch file until you find the one(s) that do not respond.

This may not necessarily be accurate if the machine is powered off and/or has been powered off long enough for its DHCP lease to expire.

You could also do a Netbios query, or query a WINS server to see if there are any responses for the computers in your list.

If you are running Active Directory or have an NT domain you could use ADSI queries or NT resource kit utilities to see if a computer account already exists.

Hope this helps as well.

@echo off

find /i "computername" c:\test.txt > nul
if errorlevel 1 goto notfound
goto :found

:found
get new name here

:notfound
rename computer here

Im not exactly sure how you plan on getting names or how you want to change computer name but this can test the txt file like you wanted

If the computername is already set and that is what you are testing then you can replace computername with %COMPUTERNAME%.

Edited by Smiley357

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.