Windows 10: VBS Script Renaming a pc script fails

Discus and support VBS Script Renaming a pc script fails in Windows 10 Support to solve the problem; can anyone tell me why this script fails with rc=5.. I am not very well versedin resolving scripts.... MUCH APPRECIATED IN ADVANCE! Const... Discussion in 'Windows 10 Support' started by changari, Feb 21, 2018.

  1. changari Win User

    VBS Script Renaming a pc script fails


    can anyone tell me why this script fails with rc=5.. I am not very well versedin resolving scripts....
    MUCH APPRECIATED IN ADVANCE!


    Const JOIN_DOMAIN = 1
    Const ACCT_CREATE = 2
    Const ACCT_DELETE = 4
    Const WIN9X_UPGRADE = 16
    Const DOMAIN_JOIN_IF_JOINED = 32
    Const JOIN_UNSECURE = 64
    Const MACHINE_PASSWORD_PASSED = 128
    Const DEFERRED_SPN_SET = 256
    Const INSTALL_INVOCATION = 262144
    Name = InputBox("Enter asset tag number:", "Identify Computer")
    username = "addcomputer"
    password = "XXXXXX"
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!" & strComputer & "\root\cimv2")
    Set colComputers = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
    For Each objComputer in colComputers
    err = objComputer.Rename(Name, Password, Username)
    If Err.Number = 0 Then
    WScript.Echo "Successfully renamed computer to " & name & "!"
    WScript.Echo "*** NOTE : You !MUST! restart pc for name change to take effect!"
    WScript.Echo "*** NOTE : You !MUST! restart pc for name change to take effect!"
    WScript.Echo "*** NOTE : You !MUST! restart pc for name change to take effect!"
    Call endit
    Else
    WScript.Echo "An error occurred renaming the computer!"
    WScript.Echo "Error Number: " & Err.Number
    WScript.Echo "Error" & Err.Description
    End If
    Next
    Sub endit
    End Sub

    :)
     
    changari, Feb 21, 2018
    #1

  2. Restoration impossible after PC Suite update

    Great VB script! Thanks a lot! Just wanted to add that instead of renaming contacts.dat you can directly use PCCSContact.db file which present in the same folder.
     
    rahulkumar1111, Feb 21, 2018
    #2
  3. JonDresser, Feb 21, 2018
    #3
  4. changari Win User

    VBS Script Renaming a pc script fails

    Byt the way .. this is being run on Windows 10 64 bit machines.
     
    changari, Feb 21, 2018
    #4
Thema:

VBS Script Renaming a pc script fails

Loading...
  1. VBS Script Renaming a pc script fails - Similar Threads - VBS Script Renaming

  2. VBS script malware

    in Windows 10 Gaming
    VBS script malware: I have accidentally downloaded malware onto my computer. It is trying to run RuneGoTOMjbvdo.vbs which i deleted. I get a warning that Windows Script host cannot find the file. I have run Malwarebytes, and frst64. I have also added and enable key to the registry to disable...
  3. VBS script malware

    in Windows 10 Software and Apps
    VBS script malware: I have accidentally downloaded malware onto my computer. It is trying to run RuneGoTOMjbvdo.vbs which i deleted. I get a warning that Windows Script host cannot find the file. I have run Malwarebytes, and frst64. I have also added and enable key to the registry to disable...
  4. VBS script opening error

    in Windows 10 Gaming
    VBS script opening error: Hi guys.A .vbs script in the startup/programs folder that should open on every startup displays the following error and the script fails to run every time.The error message is -' Creates a SR point during the first startup of the day ' Option Explicit Dim SRP, CSRP, objWMI,...
  5. VBS script opening error

    in Windows 10 Software and Apps
    VBS script opening error: Hi guys.A .vbs script in the startup/programs folder that should open on every startup displays the following error and the script fails to run every time.The error message is -' Creates a SR point during the first startup of the day ' Option Explicit Dim SRP, CSRP, objWMI,...
  6. VBS script opening error

    in Windows 10 BSOD Crashes and Debugging
    VBS script opening error: Hi guys.A .vbs script in the startup/programs folder that should open on every startup displays the following error and the script fails to run every time.The error message is -' Creates a SR point during the first startup of the day ' Option Explicit Dim SRP, CSRP, objWMI,...
  7. vbs script problem

    in Windows 10 Gaming
    vbs script problem: Script: C:\Users\User\AppData\Local\Updates\Run.vbs Line: 31 Char: 1 Error: The system cannot find the file specified. Code: 80070002 Source: null This is popping up on my windows startup. And also my windows defender is not working. Please help....
  8. vbs script problem

    in Windows 10 Software and Apps
    vbs script problem: Script: C:\Users\User\AppData\Local\Updates\Run.vbs Line: 31 Char: 1 Error: The system cannot find the file specified. Code: 80070002 Source: null This is popping up on my windows startup. And also my windows defender is not working. Please help....
  9. VBS Visual Basic Scripts

    in AntiVirus, Firewalls and System Security
    VBS Visual Basic Scripts: Im sure most of you know about VBS which stands for Visual Basic Scripts . I just want to talk about what they are and what windows defender see's in them. Now you can make vbs scripts in notepad which is really helpful since its already on your computer! People use it to...
  10. Microsoft VBS script runtime error

    in Windows 10 BSOD Crashes and Debugging
    Microsoft VBS script runtime error: I am getting a Windows Script Host pop-up that says \AppData\Roaming\vlep....It says File Not Found and Code 800A0035 - Microsoft VBS script runtime error. Does anyone know how i can fix this?...