.bat to open random file

Discussion in 'Software' started by TimLANWAN, Jun 1, 2012.

  1. TimLANWAN

    TimLANWAN Private E-2

    I need a batch file that will open a file at random. For example I can write a batch that will open all the files I specify in a list, but I want to list all the files out and then have the batch open only one and chose the file to open completely randomly. Then once the file is closed, I want the batch file to open another file on the list at random

    possible?
     
  2. GermanOne

    GermanOne Guest

  3. Toadill

    Toadill Private E-2

    Here is a simple example
    create a text file on your desktop
    open it
    In the below example the exe is M2Server
    Once you enter the code
    enter a name for the file and add the extension .bat
    When you hit save it should create a new file that looks like a gear.
    This will be your batch file and it should run just like an executable when you double click it.
    Code:
    @echo off
    rem M2Server
    cd C:\Mirserver\M2Server
    start M2Server.exe
    exit
    
     
  4. rehab101

    rehab101 Private E-2

    @TimLANWAN what kind of files are these? if they are executables thn you might be looking at a potential fork bomb..
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds