Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Little problem..Help

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Little problem..Help
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Little problem..Help - 7/11/2007 11:52:39 PM   
  NssB

 

Posts: 30
Score: 0
Joined: 6/25/2006
Status: offline

      


Hi all,

The code above is fairly straightforward, basically I want to list files/folders within a folder structure calling GetSubFolders sub recursively.
The code works very well apart from the GetFiles subroutine. Debugging the routine, I can see the Replace function processing as I'd like, however, the WMI query is either missed, fails without error, or something else.
If I seperate the GetFiles routine to a seperate file and provide it a path formed exactly as would be provided in the above, it works perfectly.
Anyone got any ideas of where this is going wrong?


Regards
NssB

< Message edited by NssB -- 7/11/2007 11:57:05 PM >


_____________________________

Its all about the code!
 
 
Post #: 1
 
 RE: Little problem..Help - 7/12/2007 12:31:02 AM   
  ginolard


Posts: 1082
Score: 21
Joined: 8/10/2005
Status: offline
I rarely, if ever use WMI for any sort of file searching/manipulation.  I find it slow and cumbersome.

use FSO instead



      

_____________________________

Author of ManagePC - http://managepc.net
AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm
Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm

(in reply to NssB)
 
 
Post #: 2
 
 RE: Little problem..Help - 7/12/2007 12:35:20 AM   
  NssB

 

Posts: 30
Score: 0
Joined: 6/25/2006
Status: offline
Your reply is corrrect, but for flexibility with regards to remote targets, WMI is what I would 'prefer' to use in this case.
As stated in my post, the subs appear to work seperately, but not together.....given identical data.... To that end, I'm rather perplexed.

Regards
NssB

(in reply to ginolard)
 
 
Post #: 3
 
 RE: Little problem..Help - 7/12/2007 1:19:31 AM   
  dm_4ever


Posts: 2725
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Well if you want to use WMI you need to change the rest of your code since you're using FSO for part of it...such as your GetSubFolders

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to NssB)
 
 
Post #: 4
 
 RE: Little problem..Help - 7/12/2007 1:20:20 AM   
  ginolard


Posts: 1082
Score: 21
Joined: 8/10/2005
Status: offline
Like I said, you really don't need WMI for this


      

_____________________________

Author of ManagePC - http://managepc.net
AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm
Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm

(in reply to NssB)
 
 
Post #: 5
 
 RE: Little problem..Help - 7/12/2007 1:44:02 AM   
  NssB

 

Posts: 30
Score: 0
Joined: 6/25/2006
Status: offline
Ginolard: Your solution is indeed with its merit. Thank you
DM: I see where you are going with regards to remote systems, I initially used WMI for the entire script. But yeah, essentially would have to change the lot.


Regards
NssB

< Message edited by NssB -- 7/12/2007 1:46:51 AM >

(in reply to NssB)
 
 
Post #: 6
 
 RE: Little problem..Help - 7/12/2007 1:58:10 AM   
  ginolard


Posts: 1082
Score: 21
Joined: 8/10/2005
Status: offline
Another reason for not using WMI for file searches is that, quite simply, you need admin rights on the remote machine whereas FSO searches don't.  They simply require you to be able to have permissions on the folders you want to browse.

Alternatively, you could use the Excel object to do file searches.

_____________________________

Author of ManagePC - http://managepc.net
AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm
Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm

(in reply to NssB)
 
 
Post #: 7
 
 RE: Little problem..Help - 7/12/2007 2:32:16 AM   
  DiGiTAL.SkReAM


Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Excel object...

Have you done any testing yet to see if you can do excel file searching with the new .Net 3.0?  I know that it incorporates a lot of the excel usability that we utilize in vbs... without having to have Excel installed.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to ginolard)
 
 
Post #: 8
 
 RE: Little problem..Help - 7/12/2007 2:41:48 AM   
  ginolard


Posts: 1082
Score: 21
Joined: 8/10/2005
Status: offline
No I haven't.  I haven't installed .Net 3.0 yet

_____________________________

Author of ManagePC - http://managepc.net
AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm
Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 9
 
 
 
  

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 >> Little problem..Help Page: [1]
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