Attention all programmers!

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

Sep 11, 2010

Attention all programmers! by TwinRetro at 8:59 AM (733 Views / 0 Likes) 1 replies

  1. TwinRetro
    OP

    Global Moderator TwinRetro Don't start nothin', Won't be nothin'

    Joined:
    Aug 29, 2008
    Messages:
    6,181
    Location:
    Las Vegas, NV
    Country:
    United States
    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

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,745
    Country:
    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
    http://commandwindows.com/

    Option 2 is there are some scripting languages ever so slightly above DOS (stuff like autoIT http://www.autoitscript.com/autoit3/index.shtml - if you recall batchDPG this is what it was written in) that will certainly be able to do what you want.
     

Share This Page