Sign in to follow this  
Followers 0
kjcdude

Get part of the computername

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



wow, that was way to easy

Share this post


Link to post
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
Sign in to follow this  
Followers 0