Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6879973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:54:54+00:00 2026-05-27T04:54:54+00:00

I have wrote this script and I was wounder if I can have it

  • 0

I have wrote this script and I was wounder if I can have it do like Y for Delete and N for not deleting the files but I am not sure how to go about adding that.

@ECHO OFF
SETLOCAL EnableDelayedExpansion

REM Set variables
SET SOURCE=C:\My Recordings
SET DEST=\\XXXXXXXX\c$\VideoArchive
SET 7ZIP=C:\Program Files\7-Zip\7z.exe

REM Compress local files with 7zip
ECHO ---------------------------------------------------------
ECHO    BEGINNING VIDEO COMPRESSION OPERATIONS
ECHO ---------------------------------------------------------
CD /D "%SOURCE%"
FOR %%f in ("*.wrf") DO (
    SET FILENAME=%%~nf
    ECHO Compressing !FILENAME!
    "!7ZIP!" a -t7z -aoa "!FILENAME!.7z" "%%f"
)

REM Copy compressed files
ECHO ---------------------------------------------------------
ECHO    COMPRESSION COMPLETE - BEGINNING COPY OPERATIONS
ECHO ---------------------------------------------------------
for /F "usebackq delims=" %%a in (`dir /b "%SOURCE%\*.7z"`) do (
    SET CURRENT_FILE=%%a
    SET CURRENT_FILE_NO_EXTENSION=%%~na

    REM Extract the month.
    for /F "usebackq tokens=3 delims=-" %%i in ('!CURRENT_FILE!') do (
        SET CURRENT_FILE_DATE=%%i
        SET FILE_MONTH=!CURRENT_FILE_DATE:~5,2!
        SET MONTH_DEST=!DEST!\!FILE_MONTH!
    )

    XCOPY "%SOURCE%\!CURRENT_FILE!" "!MONTH_DEST!\" /Y /V /I /R

    REM Confirm successful copy, then delete original
    IF !ERRORLEVEL! EQU 0 (
        ECHO Copy Operation Successful. Removing Original...
        DEL /Q "%SOURCE%\!CURRENT_FILE_NO_EXTENSION!.wrf"
        DEL /Q "%SOURCE%\!CURRENT_FILE!"
    )ELSE (
        ECHO Error while copying "%SOURCE%\!CURRENT_FILE!.
    )
)

That is my code if anyone could help that would be great.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:54:54+00:00Added an answer on May 27, 2026 at 4:54 am
    set /p DELETE=Delete [y/n]?
    if !DELETE! == y (
        ...
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have wrote this little script which generates a nice random password. The problem
When I initially wrote this script, the site design did not require the execution
Ok, I have this script that i wrote: i=1024; a=[0]*i; for k in range(0,i):
I wrote this script awhile back and have modified it to use css sprites
I have to write a Matlab script that does this: The input is 2
I have to write a script which will be hosted on differents domains. This
I wrote this code I have these errors Cannot implicitly convert type x.Program.TreeNode' to
Hi guys I wrote this code and i have two errors. Invalid rank specifier:
I've wrote this simple piece of code. And I have a slight problem with
I have this Array i wrote a function MostFreq that takes an array of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.