barno99 0 Posted April 15, 2010 Hello, I am very new to this scripting. I want to run my current script on all the PC's in the business but not the servers. All the servers names begin with LON or PAR. How do I go about detecting the first 3 characters of the computer name? I figured I would have 2 varibles 1 for "LON" and 1 for "PAR" and then use a function that if the @computername equaled those 2 varibles it would exit. I am going along the lines of:- $var1 = LON $var2 = PAR Func PCCheck If (@computername, $var1 & $var2) Exit I know that is completely wrong but if someone could put me along the right lines it would be a great help. Thanks Share this post Link to post Share on other sites
Melba23 3,457 Posted April 15, 2010 barno99, Welcome to the AutoIt forum. You need a line like this: If StringLeft(@ComputerName, 3) = "LON" Or StringLeft(@ComputerName, 3) = "PAR" Then Exit I hope that helps you along. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites