Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- title File Rotation Service Login.
- echo Hello, please log in with your user ID.
- echo Username:
- set /Z user
- if %user%==(Bussjaeger) goto password
- cls
- echo Username not found in database!
- :password
- set/p "pass=Password"
- if %pass%==(12345) goto correct
- cls
- echo Incorrect Password!
- ping localhost -n 3 >nul
- attrib +s +h (This file's name)
- :correct
- echo Welcome Mr.Bussjaeger. Activating file rotation..
- TIMEOUT /T 3
- :Start
- Set "SrcDir=E:Schem"
- Set "ExtLst=*.jpg *.png *.gif"
- Set "i=0"
- For /F "Delims=" %%A In ('Where /R "%SrcDir%" %ExtLst%') Do (Set /A i+=1
- Call Set "$[%%i%%]=%%A")
- Set /A #=(%Random%%%i)+1
- Call Start "" "%%$[%#%]%%"
- TIMEOUT /T 10000
- goto Taskkill
- :Taskkill
- taskkill /IM Microsoft.Photos.exe /F
- goto Start
- @echo off
- title File Rotation Service Login.
- rem Variables are set to blank to avoid them to have old strings set in the memory.
- set user=
- set pass=
- :start
- cls
- echo Hello, please log in with your user ID.
- set /p user=User (Case sensitive):
- rem The IF command will be case sensitive if the /i option is not used.
- rem In order to avoid case sensitive, the command should be:
- rem if /i "%user%" == "Bussjaeger" (
- if "%user%" == "Bussjaeger" (
- goto password
- ) else (
- cls
- echo Username not found in database!
- echo Press any key to try again . . .
- pause > nul
- goto start
- )
- :password
- set /p pass=Password:
- if "%pass%" == "12345" (
- goto correct
- ) else (
- cls
- echo Incorrect Password!
- goto password
- )
- rem What is the use of the next two lines?
- ping localhost -n 3 >nul
- attrib +s +h (This file's name)
- :correct
- echo Welcome Mr.Bussjaeger. Activating file rotation..
- timeout /t 3
- :start_work
- set "srcdir=e:schem"
- set "extlst=*.jpg *.png *.gif"
- set "i=0"
- rem The following line will fail. Sixtax is not correct.
- for /f "delims=" %%a in ('where /r "%srcdir%" %extlst%') do (
- set /a "i+=1"
- call set "$[%%i%%]=%%a"
- )
- set /a #=(%random%%%i)+1
- rem Not sure what the following lines should do.
- call start "" "%%$[%#%]%%"
- timeout /t 10000
- goto taskkill
- :taskkill
- taskkill /im microsoft.photos.exe /f
- goto start
Add Comment
Please, Sign In to add comment