Newbie : How to Copy Video & Audio folder from MKV to MP4 Script

Started by jonwren, March 24, 2018, 02:09:01 PM

Previous topic - Next topic

jonwren

Nothing happens it just returns

C:\Users\jonwr>batch_parameter_parsing.bat 10 20 30 40 50 60 70 80 90

C:\Users\jonwr>

dosdan

I think you're getting confused with the cmd prompt. The LHS, before the ">", shows which drive and which directory you are currently situated in. For example:

C:\Users\jonwr> means that you are on C: drive, in the jonwr subdirectory which is under the Users directory

So, to change directory:

C:\Users\jonwr> cd ..  (meaning "jump up one level")  or  cd C:\users  or  cd \users  would change the prompt and your location to:
C:\Users>

And, from there  cd C:\users\jonwr  or cd \users\jonwr or cd jonwr  would change you back to:
C:\Users\jonwr>

And if you had a D: drive,   
C:\Users\jonwr> D:   would change you to
D:\>  (the root directory of D: drive)



dosdan

Quote from: jonwren on March 27, 2018, 12:03:09 PM
Nothing happens it just returns

C:\Users\jonwr>batch_parameter_parsing.bat 10 20 30 40 50 60 70 80 90

C:\Users\jonwr>

Edit this batchfile in an text editor, change @ECHO OFF to @ECHO ON, save your change and then rerun the command line under discussion.

jonwren

Quote from: dosdan on March 27, 2018, 12:13:32 PM
I think you're getting confused with the cmd prompt. The LHS, before the ">", shows which drive and which directory you are currently situated in. For example:

C:\Users\jonwr> means that you are on C: drive, in the jonwr subdirectory which is under the Users directory

So, to change directory:

C:\Users\jonwr> cd ..  (meaning "jump up one level")  or  cd C:\users  or  cd \users  would change the prompt and your location to:
C:\Users>

And, from there  cd C:\users\jonwr  or cd \users\jonwr or cd jonwr  would change you back to:
C:\Users\jonwr>

And if you had a D: drive,   
C:\Users\jonwr> D:   would change you to
D:\>  (the root directory of D: drive)


I really don't understand this.


I've changed @ECHO OFF to @ECHO ON in my Batch
and then in CMD batch_parameter_parsing.bat 10 20 30 40 50 60 70 80 90

I still get the same result it returns to
C:\Users\jonwr>

dosdan

Quote from: jonwren on March 27, 2018, 12:26:23 PM
I really don't understand this.


I've changed @ECHO OFF to @ECHO ON in my Batch
and then in CMD batch_parameter_parsing.bat 10 20 30 40 50 60 70 80 90

I still get the same result it returns to
C:\Users\jonwr>

I forgot to mention: from any location typing DIR or dir will show you the files in this directory and any sub-directories (aka "folders") off of it.

Assuming you have created the batch_parameter_parsing.bat text file in your current directory, typing
TYPE batch_parameter_parsing.bat or type batch_parameter_parsing.bat
will show its contents on your screen. Please do this and report what you see.

Dan.



jonwren

I've typed DIR in CMD and got this...

C:\Users\jonwr>DIR
Volume in drive C has no label.
Volume Serial Number is E041-BA2F

Directory of C:\Users\jonwr

27-Mar-18  04:32 PM    <DIR>          .
27-Mar-18  04:32 PM    <DIR>          ..
24-Mar-18  09:33 PM    <DIR>          .atom
07-Mar-18  04:06 PM    <DIR>          .BestSoft
06-Mar-18  03:44 PM    <DIR>          .swt
19-Mar-18  03:59 PM    <DIR>          3D Objects
27-Mar-18  04:22 PM                 0 batch_parameter_parsing.bat
27-Mar-18  04:32 PM                 0 cd
19-Mar-18  03:59 PM    <DIR>          Contacts
27-Mar-18  03:44 PM    <DIR>          Desktop
26-Mar-18  05:05 PM    <DIR>          Documents
26-Mar-18  08:38 PM    <DIR>          Downloads
19-Mar-18  03:59 PM    <DIR>          Favorites
06-Mar-18  03:57 PM                22 id_usuario.txt
21-Mar-18  04:03 PM    <DIR>          Links
19-Mar-18  03:59 PM    <DIR>          Music
24-Mar-18  02:54 PM    <DIR>          OneDrive
21-Mar-18  11:20 AM    <DIR>          Pictures
19-Mar-18  03:59 PM    <DIR>          Saved Games
19-Mar-18  03:59 PM    <DIR>          Searches
21-Mar-18  11:20 AM    <DIR>          Videos
               3 File(s)             22 bytes
              18 Dir(s)  724,492,279,808 bytes free

jonwren

typing
TYPE batch_parameter_parsing.bat
or
type batch_parameter_parsing.bat
in CMD

I got this...

C:\Users\jonwr>TYPE batch_parameter_parsing.bat

C:\Users\jonwr>type batch_parameter_parsing.bat

C:\Users\jonwr>

dosdan

Quote from: jonwren on March 27, 2018, 12:40:02 PM

27-Mar-18  04:22 PM                 0 batch_parameter_parsing.bat
27-Mar-18  04:32 PM                 0 cd

Two things:

"0" is the size of the file in bytes. So batch_ parameter_parsing.bat has no contents. This can't be the file you are editing. If it is, you have just wiped its contents, probably by saving it incorrectly. That's why TYPE batch_parameter_parsing.bat is not displaying any lines of code.  What text editor are you using?

You should not have a empty file titled "cd" as this is an important Windows internal command. This may prevent you changing directories. To remove it, type at the cmd prompt:

DEL CD

and then type DIR at the cmd prompt again to check.

jonwren

C:\Users\jonwr>DEL CD
Could Not Find C:\Users\jonwr\CD

C:\Users\jonwr>DEL CD DIR
Could Not Find C:\Users\jonwr\CD

C:\Users\jonwr>dir
Volume in drive C has no label.
Volume Serial Number is E041-BA2F

Directory of C:\Users\jonwr

27-Mar-18  04:52 PM    <DIR>          .
27-Mar-18  04:52 PM    <DIR>          ..
24-Mar-18  09:33 PM    <DIR>          .atom
07-Mar-18  04:06 PM    <DIR>          .BestSoft
06-Mar-18  03:44 PM    <DIR>          .swt
19-Mar-18  03:59 PM    <DIR>          3D Objects
27-Mar-18  04:22 PM                 0 batch_parameter_parsing.bat
19-Mar-18  03:59 PM    <DIR>          Contacts
27-Mar-18  04:51 PM    <DIR>          Desktop
26-Mar-18  05:05 PM    <DIR>          Documents
27-Mar-18  04:48 PM    <DIR>          Downloads
19-Mar-18  03:59 PM    <DIR>          Favorites
06-Mar-18  03:57 PM                22 id_usuario.txt
21-Mar-18  04:03 PM    <DIR>          Links
19-Mar-18  03:59 PM    <DIR>          Music
24-Mar-18  02:54 PM    <DIR>          OneDrive
21-Mar-18  11:20 AM    <DIR>          Pictures
19-Mar-18  03:59 PM    <DIR>          Saved Games
19-Mar-18  03:59 PM    <DIR>          Searches
21-Mar-18  11:20 AM    <DIR>          Videos
               2 File(s)             22 bytes
              18 Dir(s)  724,487,135,232 bytes free

C:\Users\jonwr>


dosdan

Quote from: jonwren on March 27, 2018, 12:57:13 PM
C:\Users\jonwr>DEL CD
Could Not Find C:\Users\jonwr\CD

Well the CD filename is gone - that's the important thing.

What text editor are you using? In the editor are you using File | Save each time to save your changes?

jonwren


dosdan

Quote from: dosdan on March 27, 2018, 01:01:09 PM
Quote from: jonwren on March 27, 2018, 12:57:13 PM
C:\Users\jonwr>DEL CD
Could Not Find C:\Users\jonwr\CD

Well the CD filename is gone - that's the important thing.

What text editor are you using? In the editor are you using File | Save each time to save your changes?

If the editor shows lines in batch_parameters_parsing.bat use File | Close if the editor has it and then type DIR at the cmd prompt to check if its filesize has increased.

dosdan

Quote from: jonwren on March 27, 2018, 01:03:30 PM
Notepad
selecting Save after etc edit

Any when you reopen batch_parameters_parsing.bat in Notepad are you seeing any lines of code this time?

jonwren

This is what is shown in editor
Before and After DIR is the same

@echo on
cls
for %%F in (%*) do (
   ffprobe -v error -show_entries stream=codec_name -of default=noprint_wrappers=1 "%%~dpnxF"  | find "ac3">nul && echo "%%~dpnxF" contains AC3
   shift
)
pause

dosdan

Quote from: jonwren on March 27, 2018, 01:09:19 PM
This is what is shown in editor

@echo on
cls
for %%F in (%*) do (
   ffprobe -v error -show_entries stream=codec_name -of default=noprint_wrappers=1 "%%~dpnxF"  | find "ac3">nul && echo "%%~dpnxF" contains AC3
   shift
)
pause


OK. Now exit Notepad. If DIR still shows 0 as the filesize of Batch_parameters_parsing.bat, this would indicate the file that you had open in Notepad is not the same file as in this directory. (You can't have two files with the same filename in the same directory, but you can if they are in different drives or directories.)