devilsadvocate Posted June 23, 2008 Share Posted June 23, 2008 Hi there, Unfortunately, it's been some time since I did any programming nevermind AutoIt so I have chosen this to get my teeth into. I'm wondering where to start to just get the computer name displayed in a message box. Thanks for any advice you could offer. Devad Link to comment Share on other sites More sharing options...
GEOSoft Posted June 23, 2008 Share Posted June 23, 2008 Hi there,Unfortunately, it's been some time since I did any programming nevermind AutoIt so I have chosen this to get my teeth into.I'm wondering where to start to just get the computer name displayed in a message box.Thanks for any advice you could offer.DevadMsgBox(0, "Computer Name", @ComputerName) George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
orange Posted June 23, 2008 Share Posted June 23, 2008 try searching in help for "computer name" its the first result for me. msgbox (0,0, @ComputerName) Link to comment Share on other sites More sharing options...
devilsadvocate Posted June 23, 2008 Author Share Posted June 23, 2008 Thanks George! Now how would I remove the first three letters / characters off of the computer name? Our computer names are prefixed with department three character codes and it's the rest of the computer name that i need. I'm thinking that I should read the computer name in as a string but then how i would take off the first three characters I don't know. Thanks, Devad Link to comment Share on other sites More sharing options...
NELyon Posted June 23, 2008 Share Posted June 23, 2008 (edited) Thanks George! Now how would I remove the first three letters / characters off of the computer name? Our computer names are prefixed with department three character codes and it's the rest of the computer name that i need. I'm thinking that I should read the computer name in as a string but then how i would take off the first three characters I don't know. Thanks, Devad $sPrefix = StringRight(@ComputerName, 3) MsgBox(Default, Default, $sPrefix) Or $sPrefix = StringTrimLeft(@ComputerName, StringLen(@ComputerName)-3) MsgBox(Default, Default, $sPrefix) Untested, but should work. Edited June 23, 2008 by KentonBomb Link to comment Share on other sites More sharing options...
devilsadvocate Posted June 23, 2008 Author Share Posted June 23, 2008 $sPrefix = StringRight(@ComputerName, 3) MsgBox(Default, Default, $sPrefix) Or $sPrefix = StringTrimLeft(@ComputerName, StringLen(@ComputerName)-3) MsgBox(Default, Default, $sPrefix) Untested, but should work. Cheers Kenton, Thanks for pointing me in the right direction $strAsset = StringTrimLeft(@ComputerName, 3) MsgBox(64, "Asset No", $strAsset) Link to comment Share on other sites More sharing options...
LongBowNZ Posted June 24, 2008 Share Posted June 24, 2008 @ComputerName is a Macro, heres some more macros for you to try out if you like.http://www.autoitscript.com/autoit3/docs/macros.htm Link to comment Share on other sites More sharing options...
GEOSoft Posted June 24, 2008 Share Posted June 24, 2008 $cName = StringMid(@ComputerName, 4) MsgBox(0, "", "This Computer is " & $cName) George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now