.bat file help, want to automate starting Sandboxie

Satangel

BEAST
OP
Member
Joined
Nov 27, 2006
Messages
10,307
Trophies
1
Age
31
Location
Bruges, Belgium
XP
1,525
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.


@echo off
start C:\ProgramFiles\Sandboxie\SbieCtrl.exe /box:sandbox JohnDoe1 D:\Games\Steam\Steam.exe -silent -login USERNAME PASSWORD -applaunch 440 -textmode -nosound -noipx -novid -nopreload -nojoy -sw +map "cp_dustbowl"
ping -n 20 127.0.0.1>nul

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

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
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""
 
  • Like
Reactions: 1 person

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,808
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
9,795
Country
Cyprus
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)
 
  • Like
Reactions: 3 people

Satangel

BEAST
OP
Member
Joined
Nov 27, 2006
Messages
10,307
Trophies
1
Age
31
Location
Bruges, Belgium
XP
1,525
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....

C:\"Program Files"\Sandboxie\Start.exe /box:John1 D:\Games\Steam\Steam.exe
"-silent -login John1 1234Pass -applaunch 440 -textmode -nosound -noipx -novid -nopreload -nojoy -sw +map "cp_dustbowl""
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
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.
 

Minox

Thanks for the fish
Former Staff
Joined
Aug 27, 2007
Messages
6,995
Trophies
2
XP
6,155
Country
Japan
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.
 

Satangel

BEAST
OP
Member
Joined
Nov 27, 2006
Messages
10,307
Trophies
1
Age
31
Location
Bruges, Belgium
XP
1,525
Country
Belgium
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.
It kind of worked. The program location is in quotes now, the switches are not.
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.
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"
 

Satangel

BEAST
OP
Member
Joined
Nov 27, 2006
Messages
10,307
Trophies
1
Age
31
Location
Bruges, Belgium
XP
1,525
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
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    NinStar @ NinStar: It will actually make it worse