BestSync Q&A

How to run Sync-tasks when Windows logoff or shutdown?

1. Usenotepad.exeto edit a script like this:

'---------------------------------------------------------
sub shell(cmd)
' Run a command as if you were running from the command line
dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run(cmd)
Set objShell = Nothing
end sub
shell """C:\Program Files\RiseFly\BestSync 201X\BestSyncSvc.exe"" /NoSvc /file:""C:\TaskSetting\setting.fsf"" /sync:S(2)"
Wscript.Sleep 2000

set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='BestSyncSvc.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count 'it can be more than 1
Do While iniproc = 1
wscript.sleep 2000
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='BestSyncSvc.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count
Loop
set cproc=nothing
set svc=nothing
'---------------------------------------------------------

Save the script to a file, such as C:\Temp\start.vbs.
For the help document of the command line, please refer to . this page

2. Press WIN+R hotkey, run gpedit.msc.

3. Go to User Settings -> Windows Config -> Scripts
Set the script to run at logoff. That will also run on shutdown.

What should I do if I haven't found an answer to my question here?

Pleasecontact us.

BestSync online help file.