Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. :: Description = this batch file moves files outlined in article #61763
  2. :: post moving the files it STARTs the DentrixACEServer
  3. ::
  4. :: How to use:
  5. :: Run from the Server and input the Drive Letter in which the DB or Database
  6. :: resides
  7. ::
  8. :: More Information:
  9. :: 9.a If the office is on G5 PP1 Update 3 (15.2.170.0) or higher:
  10. :: 1. Stop the Dentrix Ace Service.
  11. :: 2. Rename the FAIRCOM.FCS file located in the [DriveLetter]:DENTRIXDB folder.
  12. :: 3. Copy the FAIRCOM.FCS from the DBCopyForBackup to the DB folder.
  13. :: 4. Start the Dentrix Ace Service.
  14. ::
  15. :: Date Author Change/Update
  16. :: 01-DEC-2014 PHavens 20-DEC-2014
  17. @TITLE Automate the Process Outlined in Article 9a #61763 by Paul Havens
  18.  
  19. @ECHO OFF
  20. SET tdtd=none
  21. FOR /F "tokens=2-4 delims=/ " %%i in ('date /t') do set tdtd=%%i%%j
  22. FOR /F "tokens=2-4 delims=/ " %%i in ('date /t') do set tdtd=%%i%%j%%k
  23. SET DateBack=%tdtd%
  24.  
  25. :Version
  26. CLS
  27. NET START DentrixACEServer
  28. CLS
  29. NET STOP DentrixACEServer
  30. CLS
  31.  
  32.  
  33. @ECHO OFF
  34. FOR /F "Tokens=3*" %%a in ('REG QUERY "HKEY_CURRENT_USERSOFTWAREDentrix Dental Systems, Inc.DentrixGeneral" /v COMMONPATH')DO SET xPath=%%a %%b
  35. ECHO %xPath%
  36. ECHO.
  37. @ECHO OFF
  38.  
  39. SET /P Response="Input the Drive Letter above only or q to quit >
  40. IF "%Response%"=="q" GOTO EOF ELSE GOTO TooLong
  41. IF "%Response%"=="MkDbCopy" GOTO Backup ELSE GOTO TooLong
  42. IF "%Response%"=="" GOTO Blank ELSE GOTO TooLong
  43. IF NOT EXIST "%Response%:DentrixDB" GOTO TooLong ELSE GOTO Relevent
  44.  
  45. SET "DEST_DIR=%Response%:DentrixDB"
  46. IF NOT EXIST "%Response%:DentrixCommonDBCopyForBackup" GOTO Backup ELSE GOTO Relevent
  47. IF NOT EXIST "%Response%:DentrixCommonDBCopyForBackupFaircom.FCS" GOTO Backup ELSE GOTO Relevent
  48.  
  49. :Relevent
  50. ::COPY %Response%:DentrixCommonDBCopyForBackup %tdtd%DBCopyForBackup
  51. ::%Response%:DentrixCommonDBCopyForBackup %tdtd%DBCopyForBackup
  52. RENAME %Response%:DentrixDBFaircom.FCS %tdtd%Faircom.FCS
  53.  
  54. SET "SOURCE_DIR=%Response%:DentrixCommonDBCopyForBackup"
  55. SET "FILES_TO_MOVE=Faircom.FCS"
  56.  
  57. pushd "%SOURCE_DIR%"
  58. FOR %%F IN (%FILES_TO_MOVE%) do (
  59. ECHO file "%%F"
  60. copy /Y "%%F" "%DEST_DIR%"
  61. )
  62.  
  63. CLS
  64. NET START DentrixACEServer
  65. CLS
  66. ECHO Successfully replaced the Faircom.FCS file.
  67. PAUSE
  68. EXIT
  69.  
  70. :EOF
  71. EXIT
  72.  
  73. :Irrelevent
  74. CLS
  75. @ECHO ON
  76. @ECHO If this is version 15.1.312.0 and lower there will not be a Faircom.FCS file and you do not need to follow 61763 9a, or you may need to re-export if the version is >15.1.312.0.
  77. @ECHO Then re-type the drive letter.
  78. PAUSE
  79. EXIT
  80.  
  81.  
  82. :Backup
  83. @ECHO There was not a valid DBCopyForBackup Folder, this will now create the folder and re-run with the drive letter, thank you.
  84. NET START DentrixACEServer
  85. START /d "%Response%:DentrixServer FilesDentrix_Tools" MkDbCopy.exe
  86. PAUSE
  87. NET STOP DentrixACEServer
  88. CLS
  89. GOTO Version
  90.  
  91. :Blank
  92. @ECHO No Drive letter was inputted, try again.
  93. PAUSE
  94. CLS
  95. GOTO Version
  96.  
  97. :TooLong
  98. @ECHO Input the correct drive letter, try again.
  99. PAUSE
  100. CLS
  101. GOTO Version
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement