.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

    Member Satangel BEAST

    Joined:
    Nov 27, 2006
    Messages:
    10,255
    Location:
    Bruges, Belgium
    Country:
    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

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    [member='XFlak'] should be able to help with bat files ;)
     
    2 people like this.
  3. Satangel
    OP

    Member Satangel BEAST

    Joined:
    Nov 27, 2006
    Messages:
    10,255
    Location:
    Bruges, Belgium
    Country:
    Belgium
    Anyone :( ?
     
  4. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,705
    Country:
    United Kingdom
    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

    Member XFlak Wiitired but still kicking

    Joined:
    Sep 12, 2009
    Messages:
    9,122
    Location:
    Ontario
    Country:
    Canada
    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

    Member Satangel BEAST

    Joined:
    Nov 27, 2006
    Messages:
    10,255
    Location:
    Bruges, Belgium
    Country:
    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

    Member Flame Me > You

    Joined:
    Jul 15, 2008
    Messages:
    3,379
    Country:
    wouldnt going to the sanboxie forum be a better place to ask this.
     
  8. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,705
    Country:
    United Kingdom
    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

    Supervisor Minox Spytech Employee

    Joined:
    Aug 27, 2007
    Messages:
    5,615
    Country:
    Sweden
    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

    Member Satangel BEAST

    Joined:
    Nov 27, 2006
    Messages:
    10,255
    Location:
    Bruges, Belgium
    Country:
    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

    Member Satangel BEAST

    Joined:
    Nov 27, 2006
    Messages:
    10,255
    Location:
    Bruges, Belgium
    Country:
    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
     

Share This Page