Search the Legacy Support Archive (up to v2020)
  1. Read-only archive (2005–2024). Posting is closed. Need help with MediaLab or DirectRT 2027? Email service@empirisoft.com.

    All words · “exact phrase” · -leave out

    Advanced search

Running MediaLab from a Batch File or Shortcut

  1. #1
    jarvis24 Blair Jarvis, Administrator

    Running MediaLab from a Batch File or Shortcut

    [edited from support email]

    We often run our studies in sets, with different studies following one another. Is there a way to have an icon on the desktop or a shortcut or batch file launch a particular study? It would be ideal if all the participant or RA had to do was click the icon to launch the study.

  2. #2
    jarvis24 Blair Jarvis, Administrator
    If you have v2006, you can run MediaLab from a command line or call it from a "shell" type command (e.g., using a VB program).

    As a shell command, try:
    Shell "c:\medialab\medialab.exe c:\medialab\samples\sample1\sample1.exp,15,1"

    This can also be run from the Windows "Run" command, a batch file or shortcut file (notice the difference in quotation marks)..
    "c:\my documents\medialab\medialab.exe" c:\medialab\samples\sample1\sample1.exp,44,1

    If you specify the subject and condition IDs like this then the session will start automatically with no prompts and will end upon completion. Alternatively, you may specify "0" for either or both. If you specify a 0 for both (i.e., "0,0") then MediaLab will attempt to use an autostart file if one exists. If one does NOT exist, then MediaLab will prompt you for the IDs. You may also specify one but not the other, in which case MediaLab will prompt you for the unspecified value. I wrote it this way in hope that it would give the greatest flexibility.

    Let me know how it goes!

  3. #3
    Is it possible to have medialab simply exit when it completes the experiment rather than asking if the user wants to start the next session?

    Thanks,
    Jeff

  4. #4
    jarvis24 Blair Jarvis, Administrator
    If you start the session as a batch file (as above), then this won't happen. If you are using an autostart file then you will always be asked I believe. There are often workarounds for stuff like that though--e.g., if you are concerned about subjects clicking "yes" to start the next session, you can simply insert a password protected screen at the end of the session so that only you or an RA can proceed.

  5. #5
    Will this work in ML 2004?

    Nancy Brodsky

  6. #6
    jarvis24 Blair Jarvis, Administrator
    It might. I think we may have been testing this functionality in some of the final 2004 releases.

  7. #7
    It works in ML 2004! I copied the example of the bat file syntax, modified it for our case, and saved it as a bat file.

    Thanks

    Nancy Brodsky

  8. #8
    I would like to run my study by having the id number read from the autostart.txt file but have the subject enter the condition. I am using the batch start and played around with the ,0,0 option but could not figure out a way to have MediaLab ask for the condition before starting.

    The reason for this is that it is very difficult to balance cells using autostart because the workstations being used change from day to day. It is not practical to change the id number in the .bat file everyday.

  9. #9
    jarvis24 Blair Jarvis, Administrator
    Could you just avoid the batch file and use an autostart file which enters the subject ID but prompts for the condition?