Using User Input Rather Than "strStartFolder".

Hi guys!  
This script is very simple but it's part of a project I've been working on for some time now.  Any VBS guru (or novice for that matter) will be able to tell what it does after a brief scan of the code.  Again, like I said, this is a very simple
script.
For newcomers, this script siimply looks for duplicate files in a folder on one or more of your drives.
However, I'm having 2 issues...  
First, I need to change the script to where the Wscript engine is used to ask for user input via an InputBox and for that data to be read into a variable which could be "strStartFolder"?  If
not, any variable will do, but having to enter in location you wish to search by editing the script manually is not practical.
strStartFolder instead of someone having to edit the code manually each time and enter the path to the folder you wish to scan.  In this example, I have last scanned the "Largest Vidz Appz and Musik Folder" on drive H:\.  I did this manually
of course...  
I have played with this using several methods which all only seemed to work "partially".  
The second issue I am having is that you cannot scan just a drive.  It MUST be a folder.  If you input, for example, "H:\" you will receive an error stating that either permission has been denied or the path cannot be found.  
Still being somewhat of a noob myself when it comes to scripting I'm sure there is some simple parameter I can/could have entered to fix this but I tried, "H:\*", H:\*\", H:\*.xxx"\ (.xxx being the extension of course) and other things).
 Nothing seems to work but I believe that is because of who the original VBS was coded initially.   Again, this is why I come to the greatest resource on the net.
One more thing, when all is said and done the script should ask for a user's input via Wscript so that an InputBox greets them with a message such as, "Please enter the location you wish to scan for duplicates:".  And then, depending on their
answer (being of correct syntax, etc, etc) the script runs and outputs a file named "dups.txt" using the Cscript engine.  
Please note that I have been running the script as follows to allow for output to a text document.  "C:\cscript //nologo FindDuplicates.vbs > duplicates.txt", I would like to avoid having to do this as well if possible but it's ok if not. 
Running this script by "double clicking" can be a disaster if you have tons of duplicate files.  So asking for user input is the only area where Wscript need be used.  But hey, this is why I'm here.  For guidance...  
This is cake for most of you so I will be interested in seeing the different ways you all come up with resolving this issue.  
Anyway, here is the script!  Thanks in advance for your help!
Dave
Set objDictionary = CreateObject("Scripting.Dictionary")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strStartFolder = "H:\Largest Vidz, Appz and Musik Folder"
Set objFolder = objFSO.GetFolder(strStartFolder)
Set colFiles = objFolder.Files
For Each objFile in colFiles
strName = objFile.Name
strPath = objFile.Path
If Not objDictionary.Exists(strName) Then
objDictionary.Add strName, strPath
Else
objDictionary.Item(strName) = objDictionary.Item(strName) & ";" & strPath
End If
Next
ShowSubfolders objFSO.GetFolder(strStartFolder)
For Each strKey in objDictionary.Keys
strFileName = strKey
If InStr(objDictionary.Item(strFileName), ";") Then
arrPaths = Split(objDictionary.Item(strFileName), ";")
Wscript.Echo strFileName
For Each strFilePath in arrPaths
Wscript.Echo strFilePath
Next
Wscript.Echo
End If
Next
Sub ShowSubFolders(Folder)
For Each Subfolder in Folder.SubFolders
Set objFolder = objFSO.GetFolder(Subfolder.Path)
Set colFiles = objFolder.Files
For Each objFile in colFiles
strName = objFile.Name
strPath = objFile.Path
If Not objDictionary.Exists(strName) Then
objDictionary.Add strName, strPath
Else
objDictionary.Item(strName) = objDictionary.Item(strName) & ";" & strPath
End If
Next
ShowSubFolders Subfolder
Next
End Sub
Again, thank you in advance for your help..  And why is some of my text here in this post showing in smaller font than other text?  It seems to be dependent on the line you type on?  This is,
of course, not the problem I came here to resolve, I am only curious.  ;-)
DB
PAinguIN

Thank you for your response!  
So if I used the "MyMessage" variable after the "=" in the line below then the users input should be the folder that is searched as long as your lines are added before this line correct?
Thanks again!
DB
strStartFolder = "H:\Largest Vidz, Appz and Musik Folder"
PAinguIN

Similar Messages

  • How to set iPhoto to use yahoo webmail rather than mail.app

    When emailing from within iPhoto using the email icon or via the share menu option in the task bar, mail.app launches. I prefer to use (Yahoo) webmail, rather than use an email client, so how do I change this setting?
    Thx in advance.

    Mansel
    Simply: you can’t, I’m afraid. This feature requires an E-Mail Client that supports Apple Script. Yahoo Mail is a service (not an client) that’s accessed via a Web Browser and it’s not Apple Scriptable.
    FYI:
    There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 Only*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Apple-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and 10.5* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    Regards
    TD

  • I have a separate apple id and my daughter bought a song using my ID rather than hers.  Now I've got this song that I don't care for and have no use for.  Is there a way to get it to her ID short of burning it on to CD and then uploading it to her phone?

    I have a separate apple id and my daughter bought a song using my ID rather than hers. She was playing on my computer and bought it, thinking it would download to her phone through the cloud. Now I've got this song that I don't care for and have no use for.  Is there a way to get it to her ID short of burning it on to CD and then uploading it to her phone?

    sure pretty simple.  make a backup of your current settings
    http://support.apple.com/kb/HT1766?viewlocale=en_US
    then restore device from old backup you need pics off of
    then import pics to computer
    http://support.apple.com/kb/HT4083
    you may need to save pics to camera roll first
    then restore the new backup and sync pics back to phone via itunes
    Peace, Clyde

  • HT4863 Can I use g-mail rather than outlook?

    Can I use g-mail rather than outlook with icloud?

    Welcome to the Apple Support Communities
    Outlook is a mail program, and Gmail is a mail service. You can't use an iCloud mail with Gmail because Gmail can only be used with Google mail. If you don't want to use Outlook, you can set up your iCloud mail using this information > http://support.apple.com/kb/HT4864?viewlocale=en_US
    Also, you can access to your iCloud email on http://www.icloud.com

  • ThreadReaper object used with finalizer rather than finalizer on Timer?

    Timer class has threadReaper object used with finalizer rather than finalizer on Timer itself, can anyone explain the following snippet. what is the advantage of keeping the finalize in its references rathe rthan in the original object itself.
         * This object causes the timer's task execution thread to exit
         * gracefully when there are no live references to the Timer object and no
         * tasks in the timer queue.  It is used in preference to a finalizer on
         * Timer as such a finalizer would be susceptible to a subclass's
         * finalizer forgetting to call it.
        private Object threadReaper = new Object() {
            protected void finalize() throws Throwable {
                synchronized(queue) {
                    thread.newTasksMayBeScheduled = false;
                    queue.notify(); // In case queue is empty.
        };

    skakita wrote:
    Now I am getting something. If some-one subclass the Timer class and they forgot to call the finalize on the Timer... So they have done in this way. Thank u kayaman.Just in case you're interested, that pattern is called a 'finalizer guardian'. You may find it on Google.
    Winston

  • Is it possible to create a drop down menu using form fields rather than text?

    Is it possible to create a drop down menu using form fields rather than text?

    Yes, correct - values of form fields. If one is blank, then the field would be blank - yes? If two or more have the same value that is fine.
    A standard dropdown ... As shown here. If there is an easier way to do this, I'd love to hear your suggestions. Thank you!

  • How to tell AE CS6 to use bundled Mocha rather than Pro?

    I recently upgraded my bundled Mocha from AE CS6 to Mocha Pro 4, but for some unknown reason, it won't let me export shape data in Mocha.  There seems to be no data at all, as even trying to paste in Notepad results in nothing.  Tracking data, however, works fine (both in AE and Notepad).
    Since I cannot figure out any solution in Mocha, the only thing I can do is use bundled Mocha rather than Pro... but I do not know how to tell AE to use bundled Mocha rather than Pro when I click 'Track In Mocha' (...a setting which was changed when Pro was installed).
    Does anyone know where/how I can switch it to Mocha bundled when you click on Track In Mocha?  (or, does anyone have any idea why Pro would not export shape data, whereas the same project in bundled Mocha did?)
    If anyone has any answers or theories, please let me know ASAP, as I have a project I'm trying to complete, and (as luck always has it) the weekend is now upon us, and support is closed over the weekend.

    I tried connecting MBP and TC via Ethernet - after verifying the settings that you suggested - and it does not work: if I turn Airport off, Time Machine says it can't find the TC
    Any other sugestions?
    Ok, then ethernet is not getting an ip address from the TC and is plugged in wrongly..
    You still didn't give me any idea of what actual model the linksys is.. and why is it in the network.. Is it a modem router?? If you have cable internet just throw it away and use the TC.
    If you have the linksys as modem, then bridge it.. turn off wireless and run pppoe client on the TC.
    If the ISP does not allow pppoe client mode then simply use the TC in bridge. Turn off all wireless in the linksys and just use the TC.
    Still need info on how everything is setup to analyse the problem.

  • [svn:fx-trunk] 7120: Switched to using "use namespace mx_internal" rather than using explicit namespace scoping (e.g.,  mx_internal::foo) in RichEditableText and its related classes.

    Revision: 7120
    Author:   [email protected]
    Date:     2009-05-19 23:46:06 -0700 (Tue, 19 May 2009)
    Log Message:
    Switched to using "use namespace mx_internal" rather than using explicit namespace scoping (e.g.,  mx_internal::foo) in RichEditableText and its related classes.
    Removed stale import statements.
    QE Notes: None
    Doc Notes: None
    Bugs: None
    Reviewer: Carol
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/RichEditable TextContainerManager.as

    I'm more of a 1.3 chick myself, but the words are the same just in a different language.
    1. Is Tomcat running?
    2. Have you configured the ajp13 connector on 8009 in Tomcat? (Should it be ajp13 for Apache 2.0? - I really must upgrade)

  • How can i move songs to my playlists using my iphone rather than computer?

    How can I move songs to my playlist using my iphone rather than my computer?

    @allamb & stephanW
    I found this thread via a search, I have a new iphone 5 (also i am completely new to iphone, having been the last few years on android) and i have spent 20 minutes trying to figure out how to add a song to a playlist.
    You see i sit a work and listen to dozens of tunes, and i want to add a paticular song to a particular play list, and low and behold I can't, excuse my special characters but "What the f#%k itunes/apple??? - how can this be? Such a commonly needed function and for itunes to be the number music player in the world not to have this feature is ludicrus.
    I am lucky that i only have about 500 songs on my iphone thus far, i feel sorry for stephanW with 4000+ !!
    Apple - please fix  - this is schoolboy programming stuff...

  • How to create database from scratch using user input

    what I am trying to do is to create database via my java code (using hibernate and my sql) and based on user input.
    The details like the name of table.... or the number of columns in it are all supposed to be determined from user input (only the first time).
    On subsequent run the program should remember the previously created database and hence work with it.
    Can somebody help me through this?
    Suppose I did create it using firing queries from my program then the next problem is how my program would start up next time......?????

    Anuvrat wrote:
    what I am trying to do is to create database via my java code (using hibernate and my sql) and based on user input.
    The details like the name of table.... or the number of columns in it are all supposed to be determined from user input (only the first time).
    On subsequent run the program should remember the previously created database and hence work with it.
    Can somebody help me through this?Presumably because you want to (fun) rather than because you need to (job or project.)
    If the second then don't do it.
    >
    Suppose I did create it using firing queries from my program then the next problem is how my program would start up next time......?????You would start by learning about DDL which is the common name for the languages, which vary by database, used to create the entities that represent the structure of a database. Until you figure out the syntax of that you can't do anything in java.

  • Payment Distribution to Artists by per user plays, rather than total plays

    Hello!
    I just had a thought about how payment is distributed to artists that I wanted to see if anyone might have some thoughts on. Spotify still does come under criticism on occasion for artist payment distribution - I've seen a couple of instances of people citing iTunes as providing more monetary compensation to artists since it is per download, rather than per play, among other things. This seems to be especially true for independent artists, and artists who are generally less well-known.
    I was wondering if Spotify has ever considered doing payment distributions using the
         sum[ (total artist streams per user) / (total streams per user) ] across all users
    ratio for payment calculation, rather than the currently used
         (total artist streams across Spotify) / (total streams across Spotify)
    approach, i.e. calculating the artists' play ratio by user, rather than in one giant pool. If you have considered this, I would love to hear why the current payment implementation was chosen rather than a per user method, such as the one listed above. But... 
    If a per user method has not been considered by Spotify previously, I think it would be nice - while I'm not an analyst myself, I imagine that it could lead to more revenue for independent artists, and maybe even less famous artists that are still beholden to rights owners for distribution of payment. I think it would do this because it could account for differences in number of plays per user - rather than users who tend to play more music over the course of a month contributing more all artists' payout, each user has an equal voice in how money gets distributed to artists.
    I understand that such a switch would be difficult, and possibly insurmountable in the instance of free users - so, I am positing this as an idea not for all users, but for Premium users only. With Premium, it is a feasible goal, since you have a finite number of plays, and a finite amount of money coming directly from that user, and do not have to worry about trying to calculate differences in advertisement impact for different users. Doing that ratio calculation would be relatively straightforward of a switch computationally (though quite a large change in the system nonetheless, of course). 
    I think this type of change would empower both users and artists to use Spotify more. Firstly, it would empower artists to allow Spotify to play their music because the metrics they would get per month would be more reflective of the size of their fan base, and how much importance that fan base puts on the artists' music than current metrics.
    Secondly, it would empower users more, which I think is especially important for users between 18-32 years of age. While I am not an expert on the subject, I often find that users in this age group (my age group) care a great deal about having control over where their money ends up, which in this case means knowing which rights holders and/or artists are getting the money they are spending. I know I do. Switching to this system, while still not addressing the injustices that are felt within the relationship between rights holders and artists by many, would still allow users to have more of a say in who gets their money than the current system. On top of that, it might be helpfult for Spotify itself - if using Premium is the only way for users to feel empowered by knowing how their money is distributed, it may encourage people in the free tier to upgrade to Premium in order to feel empowered.
    Just a thought. I'd love to hear what you and others have to say about this idea. 

    @Merik thanks for the warm welcome, and for the quick, informative response!
    I had the chance to take a look at that page you linked to before my original post, and saw that paragraph you quoted, as well as the bullet point about paid users having a higher "per stream" rate. I guess what I was more interested in (and perhaps this is not the right place to ask this question?) was if there was more of an in-depth "why" behind their decision (and thanks again for linking to it!) documented anywhere that I might be able to read more about. Maybe I was missing something on that page (and please let me know if so!), but the only "why" that I could find was a sentence in the paragraph you quote above:
    "We believe, however, that our service and the lives of artists will both be best if the World’s music fans enjoy more music than ever before in a legal, paid manner".
    While it's great to see their opinion, I was more curious about the line of reasoning behind that position is all. Because I do wonder whether empowering premium users to have more fine-grained control over how their money is allocated, such as by doing pay "per user", might lead to both more paid users and more revenue for independent and/or lesser-known artists - and if that's something that Spotify has researched already, I would love to hear more about the pros and cons behind such an approach!
    Thanks!

  • How to play SWF with AxShockwaveFlash control using a stream rather than a file path?

    My WinForm app downloads and plays SWF files from my server. Currently, I have an object of type AxShockwaveFlash called "flash" display the movie. The code I use to load the SWF is:
    flash.Movie = "http://example.com/file.swf"
    The URL is generated dynamically by the module based on what the user wants to watch.  I'd like to know how can I load the SWF using a memory stream rather than a file path? I have already configured my server to process the url and return the contents
    of the file. What I don't know is how to read those contents within my WinForm application as a stream instead of the default which is to just provide a URL path to the movie.
    For instance I think I can use the Net.HttpWebRequest object to make an HTTP request, and read the response contained in the resulting Net.HttpWebResponse into a stream, but I have no idea what I could do to that stream to feed it to AxShockwaveFlash
    A very similar question was posed on
    stackOverflow but I cannot make sense of the answer (I'm quite inexperienced).
    I'd appreciate your help,
    -Patrick

    Hi Patrick,
    Since this issue is mainly related to a control which belongs to third-party, I would recommend you consider posting this issue on the same site like the following thread because issues related to third-party are not supported.
    https://forums.adobe.com/thread/717505?tstart=0
    Regards.
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Force used cached/local rather than download "script" each time

    in my jsp , i have this
    <script language="javascript" src="something.js"></script>
    so each time the jsp page is loaded, the browser will gurantee go to the server and download something.js . is there anyway to force something.js to remain in user browser cache as long as possible > 30 days or so... so that the next time user visit the website, this something.js can be skipped and speed up page load time?

    I doubt it. Once the user closes his browser, I image the cache is wiped out. Also, it is not likely to keep his browser open for 30 days straight. I don't think this is a good area to look into to speed up your application. Even if you could cache the *.js, I doubt it will speed things up much. In performance tuning, you normally identify the worst bottleneck, fix it, then move on to the next one. Bottlenecks often involve fetching too much data from the database at once (example: fetching all the records from a database table rather than a subset). Also, sending too much information to the display, so much that the user can't possibly use at one viewing. In code, its often creating too many objects.

  • Can I use album artist rather than Artist on my iPod160?

    The Artist selection on the iPod has its problems as "Album Artist" is not always the same as "Artist". I know I can correct the Cover Flow problems with Artist View by use of the Sort Artist option but I do have a few questions.
    I would rather display the Album Artist rather than Artist. Is this possible? I can do it in ITunes but cannot seem to do it on the iPod itself.
    Also, is it possible to do mass changes on Sort Artist rather than hit "next", paste the change, etc. Everything I try to mass change, Sort Artist is not an option.

    Hi,
    Unfortunately, the 'album artist' field is ignored on the iPod (I hope it one day will be 'solved'). If you mark albums with multiple artists as 'compilation', the album artist in iPod coverflow is automatically set to 'various artists'. And I haven't found a way to mass-edit the sort fields either

  • N8 - Use of WLAN rather than USB lead or Bluetooth

    Is there an application available for the N8 to allow the use of WLAN to copy files across to a PC, rather than having to use Bluetooth or the USB lead.
    I quite often use Bluetooth to transfer files such as Images but WLAN would be much faster.
    History: Always Nokia since 1994 including Nokia 2140, 7110e, 6150, 6210, 6310i, 6230i, N82
    Current: Nokia N8 (Anna - I have no intention of going to Belle) - and delighted with it!

    Dukto http://store.ovi.com/content/67131?clickSource=sea​rch will do that. You will need to also install it on your computer, link is in the store description. There was an issue with it defaulting to C: on the phone and filling the memory when transferring files to the phone, so make sure you check the settings - Although I think the developer was intending to solve the problem with this newer release - there is a thread about this somewhere on here, a search for Dukto should find it.
    There is a review at http://www.symbiantweet.com/dukto-r4-transfer-file​s-over-lan-between-clients-running-symbian-windows​...
    N8-00 pc059C9F6 Belle
    808 PureView pc059P6W5

Maybe you are looking for

  • How to get black text in window title

    I have difficulty distinguishing between active windows and inactive windows because the title text for both is a shade of gray. How can I theme OS X Lion to use black text  scrollbar, and controls for active windows; gray for inactive windows? I am

  • Integration CME 8.6 with 2N IP Helios SIP Door Phone

    Good Day, I have a Cisco CME install on router 2911 with CME version 8.6 and i need to have any boday do the integration between CME 8.6 and SiP door intercome my SIP door Intercome is 2N IP Helios Door Phone With 6 button , i already did integration

  • Where to find after "Archive and Install"

    Hi everyone. I recently installed Leopard onto my Macbook. During the process, I used the archive and install feature to save all of my old data and files. Right now everything is located in the "Previous System" folder on my hard drive. I am trying

  • Music disappears from iPod

    Every four or five days I go to use my iPod (color display) and find nothing there except photos. All songs are gone. When I synch with my iTunes(iMac G5, iTunes v.1.2.1), everything gets dumped back on and it is OK for several days, then the same th

  • Palm Desktop for Windows 7

    No device Zire 71 w/Palm os 5.2.1.  Just upgraded to Windows 7.  Is there any Palm Desktop that i can download to continue using my Zire?  Had 4.1 but could not get HotSync to work.  Not crazy about 6.2, but will take at this point if i can find to d