#71280 - 2002-10-30 08:04 PM
Re: Copying a file to a range of computers
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I'm not busting on you... You haven't posted anything that I haven't said to my monitor. I'm just too lazy to type it.
I just chalk this type of Thread to GIGO. or in the words of the New Radicals, "You get what you give"
|
Top
|
|
|
|
#71281 - 2002-10-30 08:13 PM
Re: Copying a file to a range of computers
|
dbeiser
Fresh Scripter
Registered: 2001-03-22
Posts: 34
Loc: Melbourne, FL, USA
|
First, thanks Sealeopard!
Finally a constructive example I can work from, actually it was so simple it eluded me. I’m under a time crunch and must have been thinking to much.
Second,
I agree with Radimus, Lligetfa's needs a name change, let's try "The Canadian SLAMMER!". Of course, the Canadian explains it all, “GO WINGS!” He he he
Let me first get this off my chest. It's been a while since my last request for help (months) and I've noticed a huge shift in attitude here. This use to be a place you could ask a simple question, not expecting much, and eagerly get a script back instead. Not all this BS I've been getting over the past few hours.
Hey lligetfa, how about constructively explaining what I could do to improve my scripting (I’m not a programmer) vs. telling what I can't do?
What’s with your obsession with the range of numbers? Code is code; it should be flexible enough to accommodate any range of numbers!
With that said….
With that in mind, why don’t you use my outline of code and show me how you would approach the problem? And explain why I need to use Val()
Thanks,
_________________________
Dave
Melbourne, FL
|
Top
|
|
|
|
#71282 - 2002-10-30 08:25 PM
Re: Copying a file to a range of computers
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
by default if you use substr() to pull characters from a string, it returns it to you as a string.
therefore if you to a compare of "19" and "4" as strings, the "4" would be greater.
Use val() and it uses the numeric value.
Les (and others here) have no problem in helping here. He just wants specifics.
What you asked for in the first post, is not what you asked from in the later ones.
|
Top
|
|
|
|
#71283 - 2002-10-30 09:02 PM
Re: Copying a file to a range of computers
|
dbeiser
Fresh Scripter
Registered: 2001-03-22
Posts: 34
Loc: Melbourne, FL, USA
|
Thanks for the input Radimus.
The example sealeopard posted appears to work for all three ranges, however I think I'll tinker with the val() and try to incorporate it.
I still stand by my first post. I thought it was pretty straight forward, a range is a range; I should be able to plug any range into the code and have it work.
Timeout, I just thought of something. I can't use the val() statement, The letter in front of the number is required to determine the range. I'm not comparing just the range of numbers, I'm also comparing the letter designator. E for East, W for West, and M for Main. I have to know which floor it's on because the numbers are duplicated on all 3 floors.
Thoughts?
Thanks again. [ 30. October 2002, 21:14: Message edited by: dbeiser ]
_________________________
Dave
Melbourne, FL
|
Top
|
|
|
|
#71286 - 2002-10-30 09:07 PM
Re: Copying a file to a range of computers
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
In you first example you defined 3 ranges of standard machine names as: quote: xxxxxE1 - xxxxxE100 (East Floor) xxxxxM1 - xxxxxM400 (Main Floor) xxxxxW1 - xxxxxW200 (West Floor)
You stated that you needed to get three different hosts file to these computers. My substr() above did just that based on the letter. the code would have let you execute the script on your client and update every computer that was turned on.
Anyway, I am glad that you received the feedback you needed to move forward. [ 30. October 2002, 21:09: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#71287 - 2002-10-30 09:46 PM
Re: Copying a file to a range of computers
|
dbeiser
Fresh Scripter
Registered: 2001-03-22
Posts: 34
Loc: Melbourne, FL, USA
|
Howard,
I think theirs some confusion from my first post. I am not sorting by N, E, W. I apologize, I didn't have the exact workstation names until about post 12 and just used those names as an example.
Here's the exact range:
usmlbm74 thru usmlbm88 (gets hostfile1 copied)
usmlbm130 thru usmlbm144 (gets hostfile2 copied)
usmlbm146 thru usmlbm160 (gets hostfile3 copied)
I need to determine if the @WKSTA falls within the above range and copy the appropriate host file to it.
Hence, Sealeopard's example appears to work.
_________________________
Dave
Melbourne, FL
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 369 anonymous users online.
|
|
|