See this discussion: https://github.com/winnfsd/vagrant-winnfsd/issues/77
That worked for me. Except I don’t much care for the batch file used by winnfsd or vagrant-winnfsd. Here’s my batch file…
@echo off
tasklist /nh /fi "imagename eq winnfsd.exe" | findstr -i winnfsd.exe
if errorlevel 1 set NFSDISABLED=true
if [%1]==[status] (
printf "[NFS] Status: "
if defined NFSDISABLED (
printf "halted\n"
exit /b 1
)
printf "running\n"
exit /b 0
)
if [%1]==[start] (
printf "[NFS] Start: "
if defined NFSDISABLED (
start winnfsd -log off -pathFile %~dp0nfspaths
printf "started\n"
) else (
printf "already running\n"
)
exit /b 0
)
if [%1]==[halt] (
printf "[NFS] Halt: "
if defined NFSDISABLED (
printf "not running\n"
) else (
taskkill /f /im "winnfsd.exe" >nul
printf "halt\n"
)
exit /b 0
)
exit 1
Feel free to edit the path file in the start
block.
Edit
Alternatively, you could use a cli util like rbtray to right-click the minimize button to send any window to your system tray. Or you can use hidecon to hide the console window after it’s launched or hideexec to start the service as a hidden process (the latter of which can also be done in Ruby or VBS; both languages are already used in vagrant-winnfsd
).