Bitcoin Forum
June 07, 2024, 02:27:43 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help me regarding creating a batch file  (Read 275 times)
same21 (OP)
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
May 25, 2016, 01:32:26 AM
 #1

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.
npredtorch
Legendary
*
Offline Offline

Activity: 1246
Merit: 1049



View Profile
May 25, 2016, 02:40:24 AM
Last edit: May 25, 2016, 04:44:03 AM by npredtorch
 #2

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!
Ditto
Sr. Member
****
Offline Offline

Activity: 330
Merit: 250


View Profile
May 25, 2016, 01:34:31 PM
 #3

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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!