INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Zombie Mode (Windows) Solved - For me at least!  (Read 426 times)

konkeydong75

  • World Citizen
  • ***
  • Posts: 125
Zombie Mode (Windows) Solved - For me at least!
« on: July 25, 2022, 11:22:13 am »

I have been suffering from issues as described by Stricko in his post (https://yabb.jriver.com/interact/index.php/topic,124587.msg862721.html) where a client would not connect to the server when resuming from wake.

This was solved for me by creating a batch file that was run by Windows task scheduler when the machine woke from sleep to issue the following commands to exit and then restart MC

mc29.exe /mcc 20007,0
mc29.exe

Restarting MC obviously issues a WOL packet which brings the server back online, but this only solved one half of the problem. I still had issues where the MC clients would remain online, but may not be playing any media from the server library. The server would sleep, and trying to use the client in Theater Mode with a remote resulted in a zombie client again.

I realize this will not be an ideal fix for everyone, but it has worked fine for me for a few days now, has been unobtrusive, and ensures that no matter which client is online, the server is available for the entire time that the client is. Once the client is offline, the server will then follow it's usual sleep schedule and will be brought online again the next time a client is woken from sleep or powered on.

1. Ensure that each client logs into Windows with a separate username.
2. On the server, create accounts for each user with a matching password that does not expire.
3. On the server, create a new share e.g. D:\Keepalive or similar.
4. On each client, map a drive to the new share using a free drive letter - Z:\Keepalive for example.
5. On each client create a batch file e.g. keepalive.bat to run the following:-

@echo off
:repeat
@echo %RANDOM% > Z:\username.txt
ping -n 60 127.0.0.1 > NUL
goto repeat

This batch file, will repeatedly create a text file called username.txt (change the username for the actual username used on the client to avoid two clients trying to write the same filename at the same time) that contains a random number. It will then pause for a minute or two whilst it issues 60 pings to itself that are piped to NULL. Anything can be used for a pause or a wait, but this was a quick dirty test and it worked for me so I stuck with it.

6. Use Task Scheduler to run this batch file at log on of any user, delayed for 60 seconds.

As soon as a client machine is restarted, this batch file runs in the background and every couple of minutes or so, writes/overwrites a file (username.txt) containing a random number in the temp share on the server.

Whilst this is happening, the server will not sleep, so no matter how idle your online MC client is, the server library will still be available. Once each client running this task sleeps, the server will be able to sleep. but this ensures the library will remain available for any online client that requires it.

As the script is set to run repeatedly, it does not end and survives sleeping/waking.

Although the output of the batch file is hidden by turning echo off, the command prompt box may still be visible on screen which is less than ideal. If this does occur, you can use a VBScript called invis.vbs from the following link at Stackoverflow

https://stackoverflow.com/questions/298562/windows-xp-or-later-windows-how-can-i-run-a-batch-file-in-the-background-with-n

Copy the VB code shown there and save as invis.vbs in the same location as your batch file. Then in the scheduled task, change the trigger from running the batch file to run wscript.exe and in the arguments box enter

c:\path\to\batch\invis.vbs c:\path\to\batch\keepawake.bat (obvsiously replace with your correct paths)

In the start in box, enter C:\Windows\System32.

When the task is run, wscript.exe is called from system32 to run invis.vbs, which runs the batch file silently.

Depending on your AV, you may need to add an exclusion for the VB file, although I have had no issues.

Apologies for the quick dirty write up - don't have much time and wanted to get this out here before I logged off in case it could be of help to others.

Any questions, let me know!
Logged
Pages: [1]   Go Up