Bitcoin Forum

Economy => Services => Topic started by: same21 on May 25, 2016, 01:32:26 AM



Title: Help me regarding creating a batch file
Post by: same21 on May 25, 2016, 01:32:26 AM
1. create a batch file that accepts a # input

2. identify if input is odd or even

3. if input is odd, write the directory structure of the c: drive on desktop\bsit\dir.text

4. if even, delete final folder on z:

If you solve this one, just post your bitcoin address here after I confirm if it's working, for those who tried and it's not working  I'll tip you also.


Title: Re: Help me regarding creating a batch file
Post by: npredtorch on May 25, 2016, 02:40:24 AM
Code:

@echo off
set /p num="Enter Number: "
set /a numberinput = num %% 2
if %numberinput% equ 1 (
dir C:\ /a /b /-p /o:gen >C:\Users\"Your PC Username"\Desktop\bsit\dir.txt
start notepad C:\Users\"Your PC Username"\Desktop\bsit\dir.txt
) else (
@RD /S /Q "Z:\Final"
)
pause


34RYzYMm74oRxHak5dPptSLQ2J3LSnKV32
Hope that I answered it correctly. I'm not very familiar to batch file so i'm not sure if it is what you want. Goodluck!


Title: Re: Help me regarding creating a batch file
Post by: Ditto on May 25, 2016, 01:34:31 PM
Code:
@echo off
set /p num="Enter Number: "
set /a numberinput = num %% 2
if %numberinput% equ 1 (
dir C: > %USERPROFILE%\Desktop\bsit\dir.txt
) else (
dir /B /A:D > tmp.txt
powershell -command "& {Get-Content -Tail 1 tmp2.txt}" > tmp.txt
SET /p FINAL=<tmp2.txt
del tmp.txt
del tmp2.txt
del /Q %FINAL%
)
pause

1ND8zXV7ZDvoqS8GphLUU8wCTYg6wC78pi