Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


can thiswork?? profile delete script

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> can thiswork?? profile delete script
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 can thiswork?? profile delete script - 4/19/2006 2:03:00 AM   
  iceteanolemon

 

Posts: 29
Score: 0
Joined: 4/5/2006
Status: offline
I am absolutely lame at this and seem to hamburger things up something serious so excuse me for even breathing around here. I still am a glutton for punishment and will keep waddling around till I figure something out sooner or later. For the time being thanks for letting me bug you guys with sorry excuses for code.

I put a couple scripts together and tried to set up something to delete all local profiles cept a couple select ones but wanted to read the list of machines to do it from a text file and it wont work. I get expected next on line 31. I'm monkeying around with it a bit and can't get it to work. Is there some stuff you guys see (when your done laughing at it) that can be done to make it work?

Thanks guys for any input. its really appreciated!


      

< Message edited by iceteanolemon -- 4/19/2006 2:07:07 AM >
 
 
Post #: 1
 
 RE: can thiswork?? profile delete script - 4/19/2006 2:07:32 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
If this is your entire script, then it would throw errors. You have an If-Then block that is not closed by an End If and you have a For loop that is not closed by a Next. Basically block constructs like this need to be told where the block ends. You need to add this to the end of your script:

  End If
Loop

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to iceteanolemon)
 
 
Post #: 2
 
 RE: can thiswork?? profile delete script - 4/19/2006 2:25:56 AM   
  iceteanolemon

 

Posts: 29
Score: 0
Joined: 4/5/2006
Status: offline
wont i need a do while or do somewhere if im inserting loop? im mixed up a bit on where to put things.



< Message edited by iceteanolemon -- 4/19/2006 2:30:15 AM >

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: can thiswork?? profile delete script - 4/19/2006 2:30:46 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
Woops...my bad. You are correct it should be Next not Loop.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to iceteanolemon)
 
 
Post #: 4
 
 RE: can thiswork?? profile delete script - 4/19/2006 2:39:04 AM   
  iceteanolemon

 

Posts: 29
Score: 0
Joined: 4/5/2006
Status: offline
cool im not insane! ok so i do that and it tells me expected next on line 32! whats that all about? thats the line right after the next i just inserted on line 31...

I really like this stuff but these times im so not clear on the error msg and what its trying to tell me... then i throw another next in just for S&G and i get wshsheell variable undefined on line 15. i dont know if this code is the wrong way to go or im juwst not seeing it.

why couldnt i just take up knitting?

< Message edited by iceteanolemon -- 4/19/2006 2:41:14 AM >

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: can thiswork?? profile delete script - 4/19/2006 2:44:50 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
Post what you are running right now.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to iceteanolemon)
 
 
Post #: 6
 
 RE: can thiswork?? profile delete script - 4/19/2006 2:47:11 AM   
  iceteanolemon

 

Posts: 29
Score: 0
Joined: 4/5/2006
Status: offline
OK heres goes again.... once more round the whippin post.


      

This asks for another next  and when i put another next below i get undefined variable wshshell

< Message edited by iceteanolemon -- 4/19/2006 2:51:54 AM >

(in reply to ebgreen)
 
 
Post #: 7
 
 RE: can thiswork?? profile delete script - 4/19/2006 2:52:11 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
You have another For loop in there that I didn't see the first time. Try this:

      

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to iceteanolemon)
 
 
Post #: 8
 
 RE: can thiswork?? profile delete script - 4/19/2006 3:28:44 AM   
  iceteanolemon

 

Posts: 29
Score: 0
Joined: 4/5/2006
Status: offline
its soo weird. i still get that veriable undefined wshshell vb compilation error.


(in reply to ebgreen)
 
 
Post #: 9
 
 RE: can thiswork?? profile delete script - 4/19/2006 3:55:49 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
Thats because the variable is undefined. Dim the variable where you Dim all the others.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to iceteanolemon)
 
 
Post #: 10
 
 RE: can thiswork?? profile delete script - 4/19/2006 4:13:51 AM   
  iceteanolemon

 

Posts: 29
Score: 0
Joined: 4/5/2006
Status: offline
ha i got it to work by dimming all those variables. thanks for the tip on the next next but i still dont quitre understand why the next next.

I am having a problem still getting the strworkstation to work correctly though.**edit I took the doublequotes out and im getting strworkstation to work..

im geting path not found when trying it but if a insert the explicit machine name i get a permission denied (which means its working)

thanks for your help so far

why the hell im getting access denied when im administrators group on the machine.... dangit

< Message edited by iceteanolemon -- 4/19/2006 4:18:07 AM >

(in reply to ebgreen)
 
 
Post #: 11
 
 RE: can thiswork?? profile delete script - 4/19/2006 4:20:37 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
Let's have a quick reset and post the code you are running right now so we know we are working on the same thing.

I'll try to explain the Next Next. Basically a For statement begins a loop. In the big picture this is known as a block construct because it basically says "Execute this block of code this many times". In your case the "this many times" is controlled by the Each strWorkstation In RemotePC. For the interpreter to know what block of code to execute, you have to tell it where the block of code ends. You do this with the next statement. This means that every For statement must have a matching Next statement to tell it where the block of code it is supposed to execute ends. Since you have 2 For statements, you must have 2 Next statements.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to iceteanolemon)
 
 
Post #: 12
 
 RE: can thiswork?? profile delete script - 4/19/2006 5:00:10 AM   
  iceteanolemon

 

Posts: 29
Score: 0
Joined: 4/5/2006
Status: offline
Thats interesting. so i could have even more nexts one for each huh...

well heres whatim running now.i must admit i didnt know if this was gonna work this good even though im getting an access denied hahah
kinda weird because i can delete stuff on the box from here but the code get access denied.


      

(in reply to ebgreen)
 
 
Post #: 13
 
 RE: can thiswork?? profile delete script - 4/19/2006 5:16:02 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
Run this and make sure that the output looks like you think it should:


      

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to iceteanolemon)
 
 
Post #: 14
 
 RE: can thiswork?? profile delete script - 4/19/2006 6:06:45 AM   
  iceteanolemon

 

Posts: 29
Score: 0
Joined: 4/5/2006
Status: offline
heh it echoed all the directories in docs and settings correctly then errd out on a "path not found" for some reason. ill look at it again.

(in reply to ebgreen)
 
 
Post #: 15
 
 RE: can thiswork?? profile delete script - 4/19/2006 6:14:54 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
Hmmm...Don't know what would give a path not found error since the delete command is commented out.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to iceteanolemon)
 
 
Post #: 16
 
 RE: can thiswork?? profile delete script - 4/19/2006 9:54:01 AM   
  iceteanolemon

 

Posts: 29
Score: 0
Joined: 4/5/2006
Status: offline
Yeha i totally dont get it either since it is echoing the exact directory names and paths back to me!!! Ah man these things really need alot of attention to detail and even then theres the unknown for me!!!

Heres what im running and getting path not found after the darnded thing dangles the carrots in front of my face !!!


      

(in reply to ebgreen)
 
 
Post #: 17
 
 RE: can thiswork?? profile delete script - 4/20/2006 12:20:25 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
Does it give you a line number with the error?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to iceteanolemon)
 
 
Post #: 18
 
 RE: can thiswork?? profile delete script - 4/20/2006 3:38:12 AM   
  iceteanolemon

 

Posts: 29
Score: 0
Joined: 4/5/2006
Status: offline
line 21 character 2 path not found...

(in reply to ebgreen)
 
 
Post #: 19
 
 RE: can thiswork?? profile delete script - 4/20/2006 4:34:19 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
That makes me think that one of the workstations in your list is not on the network.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to iceteanolemon)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

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 >> can thiswork?? profile delete script Page: [1] 2   next >   >>
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