Just a note on the split, you can also use it to look at the characters after the hyphen ( which is the split character we are using because it is the common denomenator )
Which you do by altering the index value of x from x(0) to x(1).
Basically the split goes through the whole string and trys to find any of the characters that we told it to find, in this case the hyphen and it will store any values in between or after the hyphen into an array.
So if the string we were splitting was RM-01-Computer then
x(0) would be the first array which would contain RM
x(1) would be 01
x(2) would be Computer
So if I wanted to see what was in the middle of computer and RM then I would just use x(1) as that will always retrieve the middle value assuming that there will be 2 hyphens aka 3 values to retrieve.
If it was just the case that it will be RM-01 and you wanted what was after RM- then you would use x(1).
Basically using the arrays index
Just thought I would mention that because the wiki says
if you have a hyphen in your computer name and your want to look at the characters before that you could use.....
@gecko: Scroll to the bottom of the page and hit the 'Edit this page' button. I have added a subheading all about split() just for you
Just write something like 'Added by...' in italics so we know who to blame :P
by who to blame..... you mean who to give credit to LOL
I just wanted to make sure that people knew that it could be used for both the before the common character ( such as the hyphen ) as well as being used after the common character aka the hyphen ( again ).
So it is useful in both senses without having to use left or right of the computer or client name by so many characters ( because you dont know how many characters different people use ) where as the split just splits regardless of how many characters which saves the hassle of counting by x amount of characters which I thought would save a bit of hassle
maybe being a bit thick here but at the end you show them how to assign the script via startup and logon scripts, but can't you assign it via one or the other and not both and which one would be better to assign it as or does that depend on if they are assigning it via computer objects or user objects ( ie if you assign the script as logon then its to user objects and if its startup then its to computer objects on an OU that contains computer objects )
If that makes sense ?
Yeah I gathered you were winding me up lol, I was doing the same, the whole give and take thing
Could do with a wiki index so that the important things that get wikied can be found quickly as it builds up in a html format so that the index are links that can be clicked on to take people to the relevant sections
I'm done on that page and have been for about 4 mins
I just wanted to make sure that the 2 code snippers for the split function were showing up as they were meant to and I figured out that I was putting <code> and not <code vb> when I should of been putting <code vb> obviously
Im curious, with regards to the permissions thing on the first one, most likely a blonde moment here but you say it fails on the installing of printer drivers, but considering that the printer is actually installed on the server ( print server or whatever you want to call it ).
and when you script it it is making a connection to the server ( which has the drivers installed already on it ) to the shared printer to be used by multiple users, why would it need the driver on the client machine if its just connecting to the server to tell the printer on the server how to print the document..
I swear I must be missing something here and Im guessing I will find out soon enough....
Etc which makes me think its just a connection and ( Am most likely wrong here otherwise you wouldn't make the script a startup one )
But if its just a connection why would the client systems need the driver to print to a shared printer ?
I know that the client systems do need the driver for the relevant printer in question but I just dont understand why if your centralising the printer with the installed driver on that centralised system as to why you would have the need to repeatdly install the driver on all the other systems ?
@gecko: The reason that a AddWindowsPrinterConnection installs the drivers is because Windows tried to copy the drivers from the server if they are available. As the script runs with SYSTEM-level permissions in a startup script, this is successful where it would not be with user-level permissions.
Not all OSs process the print job themselves. For instance, anything that uses CUPS (e.g. Linux, OS X, Unix, BSD) will do it 'properly'.