Skip to content

Instantly share code, notes, and snippets.

View catwhocode's full-sized avatar

Cat who code catwhocode

View GitHub Profile
@catwhocode
catwhocode / Onedrive as a Windows Service.txt
Created February 6, 2025 13:17 — forked from f-steff/Onedrive as a Windows Service.txt
How to set up OneDrive.exe as a Windows Service, allowing synchronization without a user is logged in.
OneDrive.exe as a Windows Service
=================================
Flemming Steffensen, 2017, 2021
For our automatic build setup, we needed to fetch some files off a Sharepoint Library.
Sharepoint allows (if configured so) Lists and Libraries to be synchronized to a local folder by using the OneDrive application.
However, the OneDrive application is started when a user logs in, and in an automated build setup, this never happens.
The solusion were to disable the normal auto-start feature of OneDrive, and then install it as a service, and making sure the
service start as the computer starts.
@catwhocode
catwhocode / WindowsService.py
Last active February 11, 2025 07:43 — forked from dishantrathi/README.md
Creating a Windows Service with Python
import servicemanager
import socket
import sys
import win32event
import win32service
import win32serviceutil
class TestService(win32serviceutil.ServiceFramework):
_svc_name_ = "TestService" #Service Name (exe)
_svc_display_name_ = "Test Service" #Service Name which will display in the Winfows Services Window
<?php
namespace Dappa\AuthTests;
use Illuminate\Support\ServiceProvider;
/**
* Auth test service provider
*/
class AuthTestsServiceProvider extends ServiceProvider