Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Re: what is wrong with my push script??

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,2168
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Re: what is wrong with my push script??
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 Re: what is wrong with my push script?? - 2/26/2005 7:19:57 AM   
  canon

 

Posts: 31
Score: 0
Joined: 2/23/2005
From: Belgium
Status: offline
what for a code is it?

(in reply to kracksmith)
 
 
Post #: 21
 
 Re: what is wrong with my push script?? - 2/26/2005 9:04:12 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Pardon me ?

(in reply to kracksmith)
 
 
Post #: 22
 
 Re: what is wrong with my push script?? - 2/26/2005 11:03:40 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
quote:
Originally posted by canon

what for a code is it?




welcome at VISUALBASICSCRIPT.com

(in reply to kracksmith)
 
 
Post #: 23
 
 Re: what is wrong with my push script?? - 2/27/2005 9:49:44 PM   
  Bushmen

 

Posts: 122
Score: 0
Joined: 2/4/2005
From:
Status: offline
hey, scripting guy is microsoft

here is the link

http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch.mspx

Bushmen

(in reply to kracksmith)
 
 
Post #: 24
 
 Re: what is wrong with my push script?? - 2/27/2005 10:07:32 PM   
  Zifter


Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status: offline
I think he's referring to this site

HTH

(in reply to kracksmith)
 
 
Post #: 25
 
 Re: what is wrong with my push script?? - 2/27/2005 10:38:01 PM   
  Bushmen

 

Posts: 122
Score: 0
Joined: 2/4/2005
From:
Status: offline
ah, apologies. i'll check it out.

thanks.

bushmen

(in reply to kracksmith)
 
 
Post #: 26
 
 Re: what is wrong with my push script?? - 2/28/2005 10:44:51 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
I guess he is satisfied, no complains so far

(in reply to kracksmith)
 
 
Post #: 27
 
 Re: what is wrong with my push script?? - 2/28/2005 12:01:23 PM   
  kracksmith

 

Posts: 198
Score: 0
Joined: 2/24/2005
From:
Status: offline
Thanks again Token. It worked like a charm!!!

One little question. What if i wanted to add a user and a group?

Is this the right verbage?

DIM UserName
UserName = UCASE(objNetwork.UserName)
If UserName = "John" Then
WScript.Echo "This push worked for John!!!"
fso.CopyFile "\\blasms\I_folder\test\database3.txt", "C:\designDB\"
end if

(in reply to kracksmith)
 
 
Post #: 28
 
 Re: what is wrong with my push script?? - 2/28/2005 1:17:41 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
If you want to copy a file based on the userID, in your case, "john", then your script is correct except you would have:

If UserName = "JOHN" Then

instead of

If UserName = "John" Then

because the UserName variable will hold a string that contains ONLY upper case letters (because you convert then into upper case using hte UCASE function).

(in reply to kracksmith)
 
 
Post #: 29
 
 Re: what is wrong with my push script?? - 3/7/2005 2:55:24 AM   
  kracksmith

 

Posts: 198
Score: 0
Joined: 2/24/2005
From:
Status: offline
token can you write me a script just like the one you did but user name only instead of group?

I've been trying all week and can't get it right.

I dunno, i can't get the concept of programming.

(in reply to kracksmith)
 
 
Post #: 30
 
 Re: what is wrong with my push script?? - 3/7/2005 5:31:56 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Do you want to copy a file if the userID matches one of the pre-defined userIDs ? If so, you may use the follow code; otherwise, you will have to explain more about what you want to do.

================================================================================================
Option Explicit
Dim network, fso
Set network = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")

If UCase(network.Username) = "JOHNQ" Then
WScript.Echo "The pushes for userID JOHNQ works!!!"
fso.CopyFile "\\blasms\I_folder\test\database1.txt", "C:\designDB\"
end if

(in reply to kracksmith)
 
 
Post #: 31
 
 Re: what is wrong with my push script?? - 3/7/2005 6:27:47 AM   
  kracksmith

 

Posts: 198
Score: 0
Joined: 2/24/2005
From:
Status: offline
yes, this is exactly what I want to do.

what about the function? don't i need a function with this script?

(in reply to kracksmith)
 
 
Post #: 32
 
 Re: what is wrong with my push script?? - 3/7/2005 6:30:15 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
You don't need any kind of function because the string you want to match, in this case, "JOHNQ", is a literal string and can be used directly when doing a string comparison using the IF statement.

(in reply to kracksmith)
 
 
Post #: 33
 
 Re: what is wrong with my push script?? - 3/7/2005 7:06:22 AM   
  kracksmith

 

Posts: 198
Score: 0
Joined: 2/24/2005
From:
Status: offline
thanks for all your time

but how come the script you wrote me for the group logon needed a function?

(in reply to kracksmith)
 
 
Post #: 34
 
 Re: what is wrong with my push script?? - 3/7/2005 7:12:47 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Because if given a specific userID, you still need to *determine* the groups to which the user belongs, so you use the function for that (you do NOT HAVE to use a function, but it's just easier to write your script that way)

But if you are given a specific userID, you don't need anything else to determine the userID itself because you have already got it.

(in reply to kracksmith)
 
 
Post #: 35
 
 Re: what is wrong with my push script?? - 3/7/2005 7:22:59 AM   
  kracksmith

 

Posts: 198
Score: 0
Joined: 2/24/2005
From:
Status: offline
Right! that is right. why didn't I think of it beats me.

thanks again for your time and efforts with my problem.


p.s. I need an exact .bat file script you wrote me for the .vbs group logon script. My XP and 2000 users are set. But my Win9x users need to do the exact same thing. Management don't want to install AD Client on the Win9x machines since we are suppose to get rid of it soon. After this it should be case close finally.

(in reply to kracksmith)
 
 
Post #: 36
 
 Re: what is wrong with my push script?? - 3/7/2005 7:37:15 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
heh, you are supposed to get rid of it now :)

I'm sorry but I don't know how to do the same thing with batch programming.

I think you can tell your "Management" that win9x users will NOT BE ABLE TO have the files copied (or whatever you intend to do with the VBS script) because they fail to meet the requirement of running the scripts in the first place.

(in reply to kracksmith)
 
 
Post #: 37
 
 Re: what is wrong with my push script?? - 3/7/2005 7:42:52 AM   
  kracksmith

 

Posts: 198
Score: 0
Joined: 2/24/2005
From:
Status: offline
haha yea you know what, you are right. we are suppose to get rid of it. I was just trying to get some brownie points from some of the upper management users.

but Thanks

(in reply to kracksmith)
 
 
Post #: 38
 
 Re: what is wrong with my push script?? - 3/7/2005 10:22:45 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
heh.. No problem :)

(in reply to kracksmith)
 
 
Post #: 39
 
 
Page:  <<   < prev  1 [2]
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Re: what is wrong with my push script?? Page: <<   < prev  1 [2]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts