BestSync Q&A

How to Execute Sync Tasks During Windows Logoff or Shutdown?

1. Use notepad.exe to create 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, for example, 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. Navigate to User Settings -> Windows Config -> Scripts
Set the script to run at logoff. This will also run on shutdown.

What should I do if I can't find an answer to my question here?

Pleasecontact us.

BestSync online help file.