.bat file help, want to automate starting Sandboxie

Discussion in 'Computer Programming, Emulation, and Game Modding' started by Satangel, Jul 9, 2012.

  1. Satangel
    OP

    Satangel BEAST

    Member
    10,255
    556
    Nov 27, 2006
    Belgium
    Bruges, Belgium
    What I'm trying to do, via a .bat file, about 10 times the same process, with about 1 minute between each account.
    1. Start Sandboxie (the application)
    2. Start the correct Sandboxie (eg: JohnDoe1)
    3. Navigate in the Sandbox to the correct location, and start Steam.exe
    4. Start TF2 with the correct settings
    I've done a lot of Googling, and so far this is my .bat file.


    It just doesn't work, I think it starts Sandboxie already but selecting the correct Sandbox isn't possible atm :/
     
  2. SifJar

    SifJar Not a pirate

    Member
    6,022
    892
    Apr 4, 2009
    [member='XFlak'] should be able to help with bat files ;)
     
    2 people like this.
  3. Satangel
    OP

    Satangel BEAST

    Member
    10,255
    556
    Nov 27, 2006
    Belgium
    Bruges, Belgium
    Anyone :( ?
     
  4. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,360
    9,150
    Nov 21, 2005
    I tend not to do much with sandboxie these days but looking at http://www.sandboxie.com/index.php?StartCommandLine

    "/box:sandbox JohnDoe1"

    You said the box is JohnDoe1 so surely that would be /box:JohnDoe1

    Equally I am not entirely happy with the end command so perhaps wrap those in quotes.

    start C:\ProgramFiles\Sandboxie\SbieCtrl.exe /box:JohnDoe1 "D:\Games\Steam\Steam.exe -silent -login USERNAME PASSWORD -applaunch 440 -textmode -nosound -noipx -novid -nopreload -nojoy -sw +map "cp_dustbowl""

    I am not entirely sure why you are using windows "start" command either and by the looks of things the standard sandboxie start.exe (a different program) would do what you want without the need for the sbiectrl.exe program.
    Also as you wrote it there is no space in the c:\programfiles part which is fine if you have actually named the directory that but by default most windows installations will have a space.

    To this end I would consider something like
    "C:\Program Files\Sandboxie\Start.exe" /box:JohnDoe1 "D:\Games\Steam\Steam.exe -silent -login USERNAME PASSWORD -applaunch 440 -textmode -nosound -noipx -novid -nopreload -nojoy -sw +map "cp_dustbowl""
     
    1 person likes this.
  5. XFlak

    XFlak Wiitired but still kicking

    Member
    9,127
    533
    Sep 12, 2009
    Canada
    Ontario
    Instead of adding a ping "delay", you can just change "start" to "start /wait"

    you sure this is the correct path? C:\ProgramFiles\Sandboxie\SbieCtrl.exe

    Usually there is a space in "ProgramFiles". If you path contains any spaces make sure to surround it using quotes (")

    I've never used sandboxie before, so the cmd line help URL someone linked to earlier is very helpful (http://www.sandboxie.com/index.php?StartCommandLine), and here's one for steam (http://tgservers.com/knowledgebase/3/Command-Line-Options-Steam-Games.html)

    As someone else already indicated, you should change "/box:sandbox JohnDoe1" to /box:JohnDoe1

    Also, the path in the examples reference "C:\Program Files\Sandboxie\Start.exe", not "SbieCtrl.exe", that could be another problem

    Anyways, you might run into more issues but hopefully this is enough info to get the ball rolling with the rest of your troubleshooting.

    edit: I just read FAST6191's post, and agree with him on all points (I actually echo'd his thoughts in some instances, lol)
     
    3 people like this.
  6. Satangel
    OP

    Satangel BEAST

    Member
    10,255
    556
    Nov 27, 2006
    Belgium
    Bruges, Belgium
    Okay, thanks to your help, and some Googling on my part, I've made some progress. So far it actually starts the correct Sandbox, and starts Steam. It doesn't login though....

     
  7. Flame

    Flame Me > You

    Member
    3,868
    5,026
    Jul 15, 2008
    wouldnt going to the sanboxie forum be a better place to ask this.
     
  8. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,360
    9,150
    Nov 21, 2005
    Did it not work at all with the quotes around the whole program? You just have the quotes around the command for steam rather than around the program, program location and the switches you need to feed to it which tends not to do an awful lot.
     
  9. Minox

    Minox Spytech Employee

    Supervisor
    6,022
    2,601
    Aug 27, 2007
    Try this one, personally I don't idle but from the looks of it I think I got it to work as it should.

    Code:
    "%ProgramFiles%\Sandboxie\Start.exe" /box:John1 "D:\Games\Steam\Steam.exe" -silent -login USER PASSWORD -applaunch 440 -textmode -nosound -nopix -novid -nopreload -nojoy -sw -maxplayers 2 -secure +sv_lan 1 +map "itemtest" +sv_cheats 0
    Some smaller changes I made:
    -maxplayers 2 (from what I gather you need at least 2 slots open on a listen server for idling to work)
    -secure (probably not needed, but it should start a VAC enabled listen server)
    +sv_lan 1 (lan mode enabled, should prevent people from the Internet from attempting to connect)
    +map "itemtest" (itemtest is the one map that uses the least amount of memory out of the official Valve maps)
    +sv_cheats 0 (probably not needed, but disables cheats if for some reason it's on)


    Edit: Apparently that code tag breaks the page a bit, so make sure you copy all of it.
     
  10. Satangel
    OP

    Satangel BEAST

    Member
    10,255
    556
    Nov 27, 2006
    Belgium
    Bruges, Belgium
    It kind of worked. The program location is in quotes now, the switches are not.
    Okay, your help was the last push I needed! I can now officially say it works :yay:
    Now all it's needs to do is:
    • Do it multiple times
    • Between each start of an account wait 1 minute to not burden my PC too much
    This is what I have atm, thanks to you guys!
    Code:
    C:\"Program Files"\Sandboxie\Start.exe /box:John1 "D:\Games\Steam\Steam.exe" -silent -login John1 1234Pass -applaunch 440 -textmode -nosound -nopix -novid -nopreload -nojoy -sw -maxplayers 2 -secure +sv_lan 1 +map "itemtest"
    
     
  11. Satangel
    OP

    Satangel BEAST

    Member
    10,255
    556
    Nov 27, 2006
    Belgium
    Bruges, Belgium
    Well I found it out myself after hours of trial and error! Still the best way to really learn something IMHO, just try and see where you end up.

    Here's the code, does exactly what I want.
    Code:
    C:\"Program Files"\Sandboxie\Start.exe /box:John1 "D:\Games\Steam\Steam.exe" -silent -login John1 1234Pass -applaunch 440 -textmode -nosound -nopix -novid -nopreload -nojoy -sw -maxplayers 2 -secure +sv_lan 1 +map "itemtest"
    TIMEOUT /T 120 /NOBREAK
    
    
    The Timeout /T 120 makes sure it waits between each process, 120 seconds. The /NOBREAK makes sure it doesn't start as soon as you type something on your keyboard, without that command I think it will start when you type something.
    Well ty for everything! Topic may be closed, thanks