Attention all programmers!

Discussion in 'General Gaming Discussion' started by TwinRetro, Sep 11, 2010.

  1. TwinRetro

    TwinRetro Former Staff

    Former Staff
    Aug 29, 2008
    Hiatus Hell
    First of all, NO this is not anything to so with translations, homebrew or anything at all like that.

    I would just like a small simple program made.

    It will look in a specified folder and pick, at random, one file, and copy it to another specified folder. This is all I really want, but some other nice features, if you could include them, would be to give an option to delete the file from the original folder if the file has successfully been copied to the secondary location.

    Windows 7 compatible, please? [​IMG]

    I really don't have anything to offer for this, but it would be awesome if someone coded this for me.
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United Kingdom
    I am not as strong in vista line command prompt as I might be but aside from the random part everything else can be done with a straight up batch file.

    As for the random part you can generate a random number easily enough and you can dump names to a text file with >> (something like "dir /b >>filenames.txt") easily enough. The command prompt should be powerful enough to grab a "random" name and use that. Option 2 is to fiddle with attributes (date and time or "archive flag" and try to use that.

    "would be to give an option to delete the file from the original folder if the file has successfully been copied to the secondary location" aka check on move of is that does not do it for you
    "fc originalfile.file newfile.file" will compare the two files.
    From here you wrap it in some logic and ultimately delete the file. You probably could add it as a switch but I would just make two batch files.

    When all is said and done if you do not like batch files then there are many batch to exe programs (although make sure you pick a good one for despite the relative brevity of the file it will count as a complex script by virtue of the FOR, IF and ELSE stuff although be warned some especially stupid AV programs scream virus at such things.

    I am afraid this is going to have to one of those teach a man to fish occasions though

    Option 2 is there are some scripting languages ever so slightly above DOS (stuff like autoIT - if you recall batchDPG this is what it was written in) that will certainly be able to do what you want.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice