DIM AccessShell, strPathToAccess, strCurrentPath, WshShell, strSecurity,WshFldrs
Const OverwriteExisting = TRUE
'путь к мои документы
Set WshShell = WScript.CreateObject("Wscript.Shell")
' Создаем объект WshSpecialFolders
Set WshFldrs = WshShell.SpecialFolders
strCurrentPath=WshFldrs("MyDocuments")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'WScript.Echo "1 - " & strCurrentPath & " Турникет2011.mdb"
objFSO.CopyFile "F:\Отчеты\TURNIKET\Base\Турникет2011.mdb" ,strCurrentPath & "\" & "Turhiket.mdb" , OverwriteExisting
If Err.Number Then
WScript.Echo "Ошибка копирования."
else
'WScript.Echo "Успех"
Err.Clear
End if
'Set AccessShell = CreateObject("Access.Application")
'strAccessVersion = AccessShell.SysCmd(7)
strSecurity = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\security\level"
Set WshShell = CreateObject("WScript.Shell")
' Понижаем безопасность
If WshShell.RegRead(strSecurity) <> 1 Then
WshShell.RegWrite strSecurity, 1, "REG_DWORD"
End If
'strPathToAccess = AccessShell.sysCmd(9) & "MSACCESS.EXE "
'WScript.Echo strPathToAccess
strCurrentPath =strCurrentPath & "\" & "Turhiket.mdb"
'WScript.Echo strCurrentPath
'Set WshShell = CreateObject("WScript.Shell")
'Set AccessShell = WshShell.Exec(strPathToAccess & """" & strCurrentPath)
' Создаем объект WshShell
'Set WshShell = WScript.CreateObject("WScript.Shell")
'WScript.echo strPathToAccess & """" & strCurrentPath
'WScript.echo "MSACCESS.EXE " & """" & strCurrentPath
'Return = WshShell.Run(strPathToAccess & " """ & strCurrentPath & """", 1, true)
Return = WshShell.Run("MSACCESS.EXE " & """" & strCurrentPath & """", 1, true)
|