How to make a ts3 server start up with windows (scheduled task) or other way

I have had my TS3 server ,which is on my pc starting with windows for ages, but recently i needed to change the default file transfer port from 30033 due to repeated port scanning on that port, now i changed this with the command line & server .ini using a desktop shortcut , but when if reboot the PC the server reverts to the default file transfer port, is there any way i can get the server to start automatically and use the port i have set it to, so it will survive a restart and auto restart ?

2 Likes

Well yeah, your answer is the windows task scheduler as you expected.

Define your file transfer port in your ts3server.ini and start the server with the parameter inifile=ts3server.ini.
(place the file in your server root directory)

You can easily create new tasks in the scheduler and add the run path or parameters to it however you need it.

4 Likes

When i try using the inifile=ts3server.ini . it starts but stops within a second when i try to manually run the task to test it ? the server .ini file is in the root of the ts3 server folder, as said it works fine if i use the shortcut with that command line argument in it , but fails to with windows scheduled tasks it will start then immediately stop again ?

1 Like

That’s a weird behavior I‘ve never seen before.

To test your task you haven’t configured something wrong just start your shortcut right in your task.

If that will stop immediately, too you have done something wrong in your task management.
If not just let me know in here again.

1 Like

Not sure as to what working directory the task scheduler sets when you don’t specify one. If it isn’t the directory the binary is located in, you may have to set the working directory to the installation directory manually in the task.

1 Like

Just tested, exactly the same behaviour with the shortcut as a task it runs for a few seconds and then the server icon disappears from the task bar, and i can confirm is definitely not running, but task scheduler thinks it is running ? teamspeak3-server_win64\ts3server.exe inifile=ts3server.ini

Send a private message to me the next time you’re online again.
I can take a look into it if you want to.

Was this ever resolved? I have been trying to get everything to work, and I get this same issue. The only truly full proof way to go about any of this is to open the .exe myself, nothing else works flawlessly. Sometimes the server stops moments after being started, other times it’ll start but have myTeamSpeak ID connection issues(even when the .ini is added to the arguments), and I’ve never gotten it to start successfully with a .bat file or Task Scheduler.

It always depends on how you connect to the server (host).

For example:

A closed Windows RDP connection will not logout the user it just locks Windows (back to the login screen).

If you wanna start TeamSpeak in the background you need have an existing user with the required permissions.

Just create a task in the task scheduler and select as trigger „System Startup“.
The action needs to be the ts3server.exe and optional your arguments, e.g. inifile=ts3server.ini
As user you gonna search and select SYSTEM (not recommended but as an example).
The checkbox „Login is not required. Task uses local system resources“ will be checked automatically.
In the task settings tab uncheck the checkbox „Stop task automatically after… (x time)“.

Just a very simplified description.

I’m gonna give you a detailed description if needed.

1 Like

Currently people are busy on the TeamSpeak, and I can’t test right now… However, I have set it up on my personal computer(which is Windows 10, but I’ve done it the same way as I had been doing on Windows Server 2019) and it’s worked. The only difference is that on my personal computer the install location is C:\teamspeak3-server_win64, while on Windows Server 2019 C:\Users\USERNAME\Desktop\TeamSpeak. I also ran the task One time on my personal computer instead of At log on, and have no idea if this impacts anything. It’s a bit silly how there’s any difference between my computer acting on this .exe and me clicking it with my mouse.

I’ll update you when I test later tonight or tomorrow…

Would also like to mention that my user auto logs in, on the server, and this login triggers my task. I have no idea if I need to set some kind of delay on the task till other programs/services/resources are available that TeamSpeak Server needs to properly work.

Windows 10 and Server 2019 are basically the same.
Just to mention the location doesn’t affect the task as you said already.

As I tried the say above you need to know how you wanna run TeamSpeak.
In the background, requiring local system resources only or as a common application starting automatically if your user is logging in?

Btw. how did you enable auto login?
Did you use the netplwiz app for this?

I’m gonna prepare a task import XML for you later the day.
You will just need to import it and select the user it should start at his (auto)login.

I originally got a program, from Microsoft that set it up for me, but I learned that all I did was edit the registry, so I just removed the program and adjusted the registry appropriately. And yes, I want it ran as a common application, so it’s in the taskbar and viewable when I connect via remote desktop.

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <URI>\ts3_server</URI>
  </RegistrationInfo>
  <Triggers>
    <LogonTrigger>
      <Enabled>true</Enabled>
    </LogonTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-5-21-2473088487-1708184715-710692155-500</UserId>
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>true</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>false</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
    <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>ts3server.exe</Command>
      <Arguments>inifile=ts3server.ini</Arguments>
      <WorkingDirectory>C:\TeamSpeak3</WorkingDirectory>
    </Exec>
  </Actions>
</Task>

(1) Save this ts3server.xml
(2) Import the file into the task scheduler
(3) Change user or group
(4) Edit the trigger and select your user who’s logging in automatically
(5) Change the working directory in the Actions tab


For the future:

If you wanna set up a user to use the autologin start netplwiz in Windows.

(1) select the user for autologin
(2) uncheck User has to use login name and password
(3) You will have to confirm this action with the selected users password

1 Like

So, I solved my problem quite simply and to have TeamSpeak auto-start upon a computer restart… Just added a 1-minute delay to the trigger and everything is working perfectly.

1 Like

Just as note.

The trigger begins to count when Windows is initialized.
This means whenever your server is processing updates the start will fail because the user isn’t logged in yet.

That’s the reason why you should trigger the user login not the system start.
Btw. you can of course delay the trigger for the user login as well.

1 Like
twitch instagram twitter facebook