Guest User

Untitled

a guest
Oct 29th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. @echo off
  2. title File Rotation Service Login.
  3. echo Hello, please log in with your user ID.
  4. echo Username:
  5. set /Z user
  6. if %user%==(Bussjaeger) goto password
  7. cls
  8. echo Username not found in database!
  9. :password
  10. set/p "pass=Password"
  11. if %pass%==(12345) goto correct
  12. cls
  13. echo Incorrect Password!
  14. ping localhost -n 3 >nul
  15. attrib +s +h (This file's name)
  16. :correct
  17. echo Welcome Mr.Bussjaeger. Activating file rotation..
  18. TIMEOUT /T 3
  19. :Start
  20. Set "SrcDir=E:Schem"
  21. Set "ExtLst=*.jpg *.png *.gif"
  22. Set "i=0"
  23. For /F "Delims=" %%A In ('Where /R "%SrcDir%" %ExtLst%') Do (Set /A i+=1
  24. Call Set "$[%%i%%]=%%A")
  25. Set /A #=(%Random%%%i)+1
  26. Call Start "" "%%$[%#%]%%"
  27. TIMEOUT /T 10000
  28. goto Taskkill
  29. :Taskkill
  30. taskkill /IM Microsoft.Photos.exe /F
  31. goto Start
  32.  
  33. @echo off
  34. title File Rotation Service Login.
  35. rem Variables are set to blank to avoid them to have old strings set in the memory.
  36. set user=
  37. set pass=
  38.  
  39. :start
  40. cls
  41. echo Hello, please log in with your user ID.
  42. set /p user=User (Case sensitive):
  43. rem The IF command will be case sensitive if the /i option is not used.
  44. rem In order to avoid case sensitive, the command should be:
  45. rem if /i "%user%" == "Bussjaeger" (
  46. if "%user%" == "Bussjaeger" (
  47. goto password
  48. ) else (
  49. cls
  50. echo Username not found in database!
  51. echo Press any key to try again . . .
  52. pause > nul
  53. goto start
  54. )
  55.  
  56. :password
  57. set /p pass=Password:
  58. if "%pass%" == "12345" (
  59. goto correct
  60. ) else (
  61. cls
  62. echo Incorrect Password!
  63. goto password
  64. )
  65.  
  66. rem What is the use of the next two lines?
  67. ping localhost -n 3 >nul
  68. attrib +s +h (This file's name)
  69.  
  70. :correct
  71. echo Welcome Mr.Bussjaeger. Activating file rotation..
  72. timeout /t 3
  73.  
  74. :start_work
  75. set "srcdir=e:schem"
  76. set "extlst=*.jpg *.png *.gif"
  77. set "i=0"
  78.  
  79. rem The following line will fail. Sixtax is not correct.
  80. for /f "delims=" %%a in ('where /r "%srcdir%" %extlst%') do (
  81. set /a "i+=1"
  82. call set "$[%%i%%]=%%a"
  83. )
  84. set /a #=(%random%%%i)+1
  85.  
  86. rem Not sure what the following lines should do.
  87. call start "" "%%$[%#%]%%"
  88. timeout /t 10000
  89. goto taskkill
  90.  
  91. :taskkill
  92. taskkill /im microsoft.photos.exe /f
  93. goto start
Add Comment
Please, Sign In to add comment