Trying to create a file to run commands

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
daffied
Posts: 2
Joined: 29 Apr 2018 05:20

Trying to create a file to run commands

#1 Post by daffied » 29 Apr 2018 05:36

Hi everyone.

Looking on the internet I believe I require a .DOS command to run a task on my PC . I dont fully understand .DOS and im not fully upto speed but any help would be appriciated.

Let me explain what im trying to do :-

Im trying to create a task so that I can click on a shortcut and get it to create a folder in C:\Downloads and ask me to name the folder.

I then have loads of individual files in C:\Downloads of which I need moving into folder when created.

I then need a message box or something to pop up asking if I have attached the PDF files and if answer is "YES" I need it to carry on and if "NO" I need it to advise me with a message stating "attach the PDF file in folder and rerun command" and after 10 secs close the command.

If answer is "YES" I need it to ask me to input a password for the folder and then zip the folder. I have 7zip or windows one but NOT win zip.
Finally after the folder zipped I need it to ask me if I want to move the files to A) AAA DOWNLOADS or B) BBB DOWNLOADS and select which one.
Once selected I need it moved to the one i selected it to be moved to.

What I also need if poss when zipped I need it to keep the folder name for the zipped folder that I created the same as the one I named before zipping.

AAA downloads to save to C:\Mydocuments\AAA DOWLOADS
BBB downloads to save to C:\Mydocuments\BBB DOWLOADS

The original UNZIPPED folder I always need moved to C:\Mydocuments\CCC DOWLOADS once zipped file moved into AAA or BBB downloads.

Any ideas or does anyone know where I can find commands on the web so that I can give it a try writing my own script and ask someone to check on here?

daffied
Posts: 2
Joined: 29 Apr 2018 05:20

Re: Trying to create a file to run commands

#2 Post by daffied » 01 May 2018 01:54

Ladies and Gents

Been looking around and I was given this command by a member on here a while ago to what I believe to be create a new folder and move data and password protect.

Code: Select all

@echo off
setlocal enableExtensions enableDelayedExpansion
set "strDLFolder=C:\Downloads"
if not exist "%strDLFolder%" md "%strDLFolder%"

pushd "%strDLFolder%"
2>nul (>nul dir /b /A:-D *) || exit /b

:do
set "strNewFolder="
set /p "strNewFolder=Enter the name of the folder to be created: "
if not ^"!strNewFolder:"=!" == "!strNewFolder!" goto :do
md "%strNewFolder%" || goto :do

move "*" "%strNewFolder%"
"C:\Program Files\7zip\7z.exe" a "C:\COMPLETED\%strNewFolder%.zip" -t"zip" -m"em=ZipCrypto" "%strNewFolder%" -p
popd
goto :eof
I creates the file no problem but that seems to be it. Are we able to add to these commands ?

I then need a message box or something to pop up asking if I have attached the PDF files and if answer is "YES" I need it to carry on and if "NO" I need it to advise me with a message stating "attach the PDF file in folder and rerun command" and after 10 secs close the command.

If answer is "YES" I need it to ask me to input a password for the folder and then zip the folder. I have 7zip or windows one but NOT win zip.
Finally after the folder zipped I need it to ask me if I want to move the files to A) AAA DOWNLOADS or B) BBB DOWNLOADS and select which one.
Once selected I need it moved to the one i selected it to be moved to.

What I also need if poss when zipped I need it to keep the folder name for the zipped folder that I created the same as the one I named before zipping.

AAA downloads to save to C:\Mydocuments\AAA DOWLOADS
BBB downloads to save to C:\Mydocuments\BBB DOWLOADS

The original UNZIPPED folder I always need moved to C:\Mydocuments\CCC DOWLOADS once zipped file moved into AAA or BBB downloads.

Thanks

Post Reply