# Keeping Syncthing Running: Windows 7 & Cygwin

**URL:** https://forum.syncthing.net/t/keeping-syncthing-running-windows-7-cygwin/401
**Category:** Howto
**Created:** [June 17, 2014, 11:58am UTC](https://forum.syncthing.net/t/keeping-syncthing-running-windows-7-cygwin/401 "2014-06-17T11:58:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Folcr](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/f/91b2a8/32.png) [@Folcr](https://forum.syncthing.net/u/Folcr)
#### Post date: [June 6, 2014, 1:17pm UTC](https://forum.syncthing.net/t/keeping-syncthing-running-windows-7-cygwin/401/1 "2014-06-06T13:17:18Z")

</div>

For those who want to start syncthing as a service under windows (7) using the cygwin environment here is a bash script that expects the syncthing exe under for personal directory/bin Start it using the cygwin bash shell and it stays silently in the background and logs in files.

```bash
#!/bin/bash
# wrapper script to syncthing executable
#set -x

DATE=`date +%Y-%m-%d_%H-%M-%S`
IDENT=`basename $0`
OUT="${IDENT}.out"
ERR="${IDENT}.err"
LOG="${IDENT}.log"

cd $USERPROFILE
./bin/syncthing.exe -home="${LOCALAPPDATA}/Syncthing" 1>>$OUT 2>>$ERR &
echo "$IDENT started at $DATE." >>$LOG

exit 0

```

---

<div class="post-metadata">

### Author: ![jonnojohnson](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/ecae2f/32.png) [@jonnojohnson](https://forum.syncthing.net/u/jonnojohnson)
#### Post date: [July 3, 2014, 6:31pm UTC](https://forum.syncthing.net/t/keeping-syncthing-running-windows-7-cygwin/401/2 "2014-07-03T18:31:04Z")

</div>

This really needs to be built into an installer but thanks for the suggestion.

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [May 12, 2017, 1:17pm UTC](https://forum.syncthing.net/t/keeping-syncthing-running-windows-7-cygwin/401/3 "2017-05-12T13:17:39Z")

</div>


