Jump to content

Get part of the computername


kjcdude
 Share

Recommended Posts

I need to create a cleaner way to get the last 3 characters of a PC name.

Below is how i do it currently, but it's pretty sloppy.

run("C:\WINDOWS\system32\notepad.exe")
sleep(500)
If Not WinActive("Untitled - Notepad","") Then
    WinActivate("Untitled - Notepad",""
    WinWaitActive("Untitled - Notepad","")
EndIf
send(@ComputerName)
sleep(100)
If Not WinActive("Untitled - Notepad","") Then
    WinActivate("Untitled - Notepad",""
    WinWaitActive("Untitled - Notepad","")
EndIf
send("{shiftdown}{left}{left}{left}{shiftup}{ctrldown}c{ctrlup}")
sleep(500)
$compnum = ClipGet()
WinClose("Untitled - Notepad","")
send("{right}{enter}")
Edited by kjcdude
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...