batch-file,time,echo , Echo of time not displayed at end of batch file


Echo of time not displayed at end of batch file

Question:

Tag: batch-file,time,echo

Here is my batch file:

@echo off

set start=%time%
echo %start%

for /d %%i in (*) do (
  mkdir "%1\%%i"
  cd %%i
  for %%j in (*.mp4) do (
    echo "%1\%%i\%%j
    "..\ffmpeg32" -loglevel panic -i "%%j" -c:v libx264 -preset fast-crf 50 -c:a copy -y "%1\%%i\%%j"
  )
  cd ..
)

set end=%time%
echo %start%
echo %end%

goto: eof

The time is echoed at the start. However, nothing is echoed at the end.

Output:

H:\HHVL\one-file>processandcopy.bat H:\HHVL\testdir
 9:58:41.94
"H:\HHVL\testdir\vid\vid.mp4

H:\HHVL\one-file>

Answer:

ffmpeg32 never returns. Add a START or CALL infront of this line.
Add a REM in front of this line just to see if the batch is executed to the last line.
Also the last line is wrong. Another clue it's just not executed completly. You would get an error message if this line would be hit. The last line must be goto :eof (note the position of the colon)


Related:


Delete files from folder [Windows]


windows,batch-file
The problem is as follows - I have a text file with an imagelist which contains the names of photos. The photos reside somewhere else on a hard drive. How do I delete/move those photos which names are in imagelist? Is there any batch routine?...

How to Minus time with python


python,time
I'd like to get the time before X seconds before datetime.time.now(). For example if the time.now() is 12:59:00 so If I minus 59, I want to get 12:00:00. I can't find a way to do that. Any help will be appreciated....

Getting Respond Time from Ping Command


batch-file,ping
I'm trying to create a batch file that will ping a certain server and will only display the respond time. I don't mind if value is stored in a variable or not. If you do a normal ping you get: Reply from <hostname/server>: bytes=#byte_value time=#time_value TTL=#TTL_value And I only want:...

Passing argument to python script within a batch file in Windows


python,batch-file
I have a python script that can be called in Windows as: python.exe do_my_work.py param > output.csv param is an input parameter. I also have a txt file called params.txt that contains many lines, each line is a value for the parameter of the python script: hello world this is...

Android - At Minutes to a Time hh.mm.ss


java,android,date,time
i,ve got a problem which i cant solve at the moment. I already googled for it and found some solutions, but all of them not rly match my problem. So i get 2 Strings from SQL Database in the format hh:mm:ss. The first String is a time, for example "14:30:00"...

Is there a way to output file size on disk in batch?


file,batch-file,filesize
Is there a way to get the size on disk of a file like in the properties window: I have tried: (inside a batch file) echo %~z1 , for %i in (TestFile.txt) do echo %~zi , dir But they only return the size of the file(s). Is there any way...

Batch file %%i was unexpected at this time


variables,batch-file
I am trying to get a patch file to set a variable to the number of instances that are running for a particular executable but am getting this error: %%i was unexpected at this time Here is my code: for /f %%i in ('wmic process where name="chrome.exe" ^| find "chrome.exe"...

Batch File Return Codes with executables


batch-file,exe
Possibly a really dumb question: If a batch file runs an executable and the executable fails, does the batch file return the error code of the executable or does it return 0 for finishing its code? (or some other return code?) Relevance: I'm created tasks for a task scheduler to...

How do you start a function at a certain time in Python?


python,multithreading,events,time,condition
I have a list of timestamps, and I need to call a specific method when those timestamps are reached. Those timestamps are roughly 20ms apart. At the moment I am using busy waiting in a separate thread, but I am worried about the CPU overload. Example : while True: if...

Teradata Convert DATE to midnight


date,time,teradata
below is the original code convert(datetime, (substring(convert(varchar(26), convert(datetime,getdate())),1,12) + '23:59:59:996')) output is = 6/17/2015 11:59:59.996 I converted it to Teradata below CAST(CURRENT_TIMESTAMP AS DATE FORMAT 'MM/DD/YYYY') || ' 23:59:59:999990' but upon compiling my store proc, it produces an error below Invalid or missing expression 'E(5404):Datetime field overflow.'. Is there a...

Batch - Comparing two txt files


windows,batch-file,text,comparison
I have some difficulties comparing two txt files with batch. I used the "findstr" function with many option matchings but none works (for example FINDSTR /I /V /B /G:file1.txt file2.txt). I have a first txt file as following: File1.txt Object 1 Argument 50 Object 2 Argument 10 Object 3 Argument...

Convert double to time_t


c++,time,standards,chrono,time-t
I have a double containing seconds. I would like to convert this into a time_t. I can't find a standard function which accomplishes this. Do I have to fill out the time_t by hand?...

How to show the place and only the words found Findstr?


batch-file,findstr
I wonder how do I show the location where the words were found in findstr? My Code: Set "LFiles=%temp%\Files\*.txt">nul 2>&1 Findstr /li /G:"List.txt" "%LFiles%">"Result.TxT" (for /F %%a in (List.txt) do ( Findstr /li /C:"%%a" "%LFiles%" > NUL if not errorlevel 1 echo %%a ))>"Result2.TxT" List: Disc Music Song Album Result:...

Convert batch command to python


python,batch-file
I am trying to convert a .bat file to python, almost everything is working fine, only the compression part is not working, I point out the flags and the path to the "rar.exe", but it's not working at all in the python version. What I need to correct to have...

batch result me “echo off” instead the proper result


batch-file,cmd
I have a little problem with the next code @Echo off Title STARTING cls echo. echo Checking running services... echo. timeout /t 2 /nobreak >NUL tasklist /fi "imagename eq cmd.exe" /v | find /I /N "DATABASESERVER" >NUL if "%ERRORLEVEL%"=="1" ( cls echo. echo Database is not running, now will start!...

Batch file to open multiple instances of cmd and run Ruby script in each instance


ruby,windows,batch-file,cmd,watir-webdriver
I'm trying to open multiple instances of cmd up which each run a ruby script at the same time. For background into the scripts, each of these ruby scripts run watir-webdriver and spawn new browser instances. All of this should happen instantaneously. Here's what I've tried: start cmd /k cd...

Batch script terminates in case of error when using pipe operator


batch-file,error-handling,pipe
I need to perferm error handling (check ERRORLEVEL) on an operation involving the pipe operator, but instead of the script continuing with a non-zero ERRORLEVEL, it terminates immediately. How can I avoid this behavior? Consider the following example. (Note that is a simplified constructed example to illustrate the problem -...

How to convert date into timeago


javascript,html5,time,timeago
I am trying to convert a date field in a "timeago" format using jquery.timeago.js $("time.timeago").timeago(); var userSpan = document.createElement("span"); userSpan.setAttribute("class", "text-muted"); userSpan.appendChild(document.createTextNode(message.usernameSender +" | ")); var timeTag = document.createElement("time"); timeTag.setAttribute("class", "timeago"); timeTag.setAttribute("datetime",document.createTextNode(message.date)); userSpan.appendChild(timeTag); This javascript will genearate the following code <span...

Batch file rename output folder


batch-file
So I have the following code to overlay a logo image over some videos. Its working great, the only problem I have is since my logo has the naming like "0001.logo.png", the output rar file doesnt set the right file extension, it sets the "myFolder_0001.logo" extension. Is it possible to...

Win7 Batch File - Moving Subfolders(& Files) to Grand-Parent Directory


batch-file,cmd,merge,move,subdirectories
I have a somewhat complicated problem. I've downloaded an archived website from archive.org using Httrack and now I have thousands of subfolders and files I need to merge before I can rebuild it. I'm trying to write a batch file to solve the problem. But my search results never come...

How do i handle ERRORLEVEL 9 in cmd


batch-file,batch-processing
I have developed a batch script which checks for the version of the software installed on a machine and based on the version it picks up the correct version patch and installs it (runs) on the machine. However i am facing an issue where when i check for a particular...

Batch ffmpeg and compress the files


batch-file,ffmpeg
I am doing a bunch of conversions with ffmpeg, where I need to watermark the content. I am using a batch file to run the ffmpeg application, but I want to automate all of this. for %%a in ("*.mp4*") do ffmpeg -i "%%a" -i logo.png -filter_complex overlay "newfiles\%%~na.mp4" pause Source...

Open website url links with parameter by using a batch file


url,batch-file,parameters
I am trying to open some website url links with a parameter in my browser. I made a batch file using this code : @echo off start "images" "www.images.com/1000/image.jpg" start "images" "www.images.com/1001/image.jpg" start "images" "www.images.com/1002/image.jpg" ... ... start "images" "www.images.com/5000/image.jpg" All I want is to create a For loop that...

Fastest way to count lines in a file


batch-file,dos
I have huge CSV file, which I want to know the total number of rows in which. Currently I am using something like this, which works perfectly, but it's slow: FIND /c ";" FILENAME.csv But I dunno if that's the fastest way to iterate through all lines in a CSV....

Changing input path in Batch - path manipulating/modification


batch-file
I have a simple batch like this: SETLOCAL @echo off SET sourceRoot=d:\SVN\Project\Debug\General\ServicePortal\bin SET destinationRoute=d:\SVN\Project\Debug\General\Admin Project\ I can pass "d:\SVN\Project\Debug\General\Admin Project" through parameter to the bacth, but I don't know how can I cut the last folder "\Admin Project" and combine with "\ServicePortal\bin". Is it possible? Thx in advance...

Convert long int seconds to double precision floating-point value


c++,date,datetime,time,converter
I have a long int variable wich containes seconds since Jan. 1, 1970 in this format: long int seconds = 1231241242144214; i need to convert this seconds to double precision floating-point value. The integer part of the value is the number of days since midnight, 30 December 1899. The fractional...

bat file script to check if string contains other string


windows,batch-file,cmd
I need to write a batch file that will check if a variable contains specific value. I tried to do the following: If "%%a"=="%%a:%pattern%" ( echo Yes ) else ( echo No ) input example: %%a="bob binson" %patern%="binson" I never get Yes printed! can anyone please tell what i missed...

Time format conversion with PHP


php,time
If have the duration for a recipe in the format 1H10M (1 hour, 10 minutes) or 20M (20 minutes). I want to use the format as described in the parentheses. I've tried using strtotime() without luck. Any help would be greatly appreciated....

Batch script ends after for loop


windows,batch-file
I've got a batch file that executes a program along with sequential (numbered) macros and calls another batch file that monitors when it is finished before it begins the next iteration. I can't use Start /wait or other "ordering" commands when launching the program because it is started with a...

display message if time difference is greater than 50 minutes - php


php,datetime,time
Basically i'm getting time difference between current time and database time. $cur_time = time(); $db_time = $rs[$k]['update_time']; $diff = abs($cur_time - $db_time); $months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); $days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); $hours = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24...

String parsing with batch scripting


windows,string,parsing,batch-file,xml-parsing
I have a file called pictures.xml and it contains some pictures information like: <ResourcePicture Name="a.jpg"> <GeneratedPicture Name="b.jpg"/> <GeneratedPicture Name="c.jpg"/> </ResourcePicture> <ResourcePicture Name="z1.jpg"> <GeneratedPicture Name="z2.jpg"/> <GeneratedPicture Name="z3.jpg"/> <GeneratedPicture Name="z4.jpg"/> </ResourcePicture> What I want do do is to get each line in for loop and print the names of the pictures. Sample...

String manipulation with batch scripting


windows,string,batch-file,space
I need to save the variable in %%c temporarily which comes from a for loop. But when I try to do that, the content changes unexpectedly. Some space characters appear at the end of the string. The content of %%c is a.jpg by the way. echo %%ca REM prints a.jpga...

Convert time based on timezone using java.time


java,time,java-8,java-time
How to change the time based on timezone in LocalDateTime, here i have built a date with Time zone as EST, now i need to find the UTC of the corresponding time. please help me how to solve this String str = "16Jun2015_153556"; DateTimeFormatter formatter = DateTimeFormatter.ofPattern("ddMMMyyyy_HHmmss"); formatter.withZone(ZoneId.of("EST5EDT")); LocalDateTime dateTime...

convert time to to 12 hour by manipulate string


javascript,jquery,datetime,time
"2015-06-23 14:00:00" I tried to format above date time into 12 hour base but stuck in somewhere. function formatDate(raw_date){ var right = raw_date.substring(10, 0); var hours = ((right[0].substring(2,0) + 11) % 12 + 1); var min = raw_date.substring(14,16); var suffix = right[1] >= 12 ? "PM":"AM"; right[1] = ((right[1] +...

Batch-Script: Replace every “@” in file name with “_” in network drive including subfolders


batch-file,replace,folder,filenames
My Problem is this: I want to replace every Special character such as "@" in file names. Example: old file: [email protected] new file: test_home.txt This should be done in a special chosen Folder including subfolders. The user should easily Change the Location (Folder). Thx guys Alright Well, I will give...

Format a command in powershell including a comma, can't find the right way to escape


powershell,batch-file,escaping,powershell-v2.0,comma
I have a command that I need to run in a Powershell script, the command is : ".\pacli DELETEUSER DESTUSER='"[email protected]`,com"' sessionid=333" | invoke-expression The comma (,) in here :[email protected],com is not a mistake, and that's what is giving me the hard time. I tried to escape the comma with `...

If exist and errorlevels in a batch (.bat) file


windows,batch-file,command-line
I'm trying to run a delete command on the result of an SQL command but only if it returns an error code of 0. Below is my code: SqlCmd command... REM if SqlCmd command is successful run the below if exist statement if errorlevel 0 ( REM if the file...

As only show the words found in the findstr


batch-file,findstr
How do I display only the words found in the search instead of displaying the lines? My code: Findstr /li /G:"List.txt" "File.txt">"Result.TxT" List: Disc Music Song Album Result: DISC1312we7das67da 13dsdsa67dsahdsa7aMUSIC dsadsdfdsaSONG1223234235 The desired result: Disc Music Song ...

Parsing the text file line-by-line using batch script (batch file)


windows,batch-file,scripting,cmd
So, I am programming in the batch script and I came across this issue. The following code will take yourwords.txt file and parse it. The existedWord variable will have the last word of the text file. So, everytime when I run this program it will only compare the user's input...

Batch file to check program installation


batch-file
I am trying to determine if some program has been installed and, if it has, open it. If the program has not been installed, an alternate program should open. For example, if Notepad++ has been installed, the script should open that; if not, Notepad should be opened instead. Any advice...

Formating issue with md5deep


batch-file,hash,md5
So I am making a program in batch and it requires a text file to be hashed then the hash has to be saved to a text file. I already have that part done but when it saves to the text file it saves like this f558e01b798b0390ab6206679a6926a7 C:\Users\computer\Desktop\tmpfile.txt So my...

Execute a batch file before executing in a shortcut (.lnk)


windows,batch-file,lnk
I have multiple versions of a program called Siemens NX. NX uses environmental variables for configuration. I need NX 10.0 to use a different set of environmental variables than my NX 7.5 which uses the system environmental variables. Therefore, I have written a batch file that setups the environmental variables...

Create a bat file that will run git and then run script


git,batch-file
I'm trying to write a batch file that when I run it will clone a repository locally. To open the git I have the following command: C:\Windows\System32\cmd.exe /c "%LOCALAPPDATA%\Atlassian\SourceTree\git_local\bin\sh.exe" --login -i However no matter what command I put in after this it never runs. I have read somewhere that this...

Garbage char returned by Shell.StdOut.ReadAll


batch-file,vbscript,stdout
Here is my code Set objFSO = CreateObject("Scripting.FileSystemObject") a = "@echo off && " & _ "pushd ""\\xxxxx.local\cfs\Development\Docs\Baseline"" &&" & _ "cls &&" & _ "dir /b /a-d &&" & _ "popd" Set objShell = CreateObject("WScript.Shell").Exec("%comspec% /c " & a) execStdOut = objShell.StdOut.ReadAll() msgbox execStdOut Basically I am trying to...

I cannot use the msg command in cmd (or batch for that matter). How can I fix this?


windows,batch-file
While in cmd or making a batch file, I cannot use the command msg. When I try to use it, it returns the error msg is not recognized as an internal or external command, operable program or batch file." I'm pretty sure the error is that im missing a msg.exe...

PHP Timezone not working correctly


php,date,time,timezone
So we have in-house servers here in this EDT part of the USA America/New_York and for someone reason, this [SSCCE][1] code is not working. <?php echo date_default_timezone_get() . " <br />"; $dateCal = "2015-06-22 13:00:00"; // EDT Time $schedule_date = new DateTime($dateCal, new DateTimeZone("America/Chicago") ); echo $dateCal . " <br...

Small Basic - How to check if a date is passed?


time,smallbasic
I'm trying to make a license verification that should expire in a week with small basic. I could make a script that would write down the day the license was activated and that would expire the license as soon as the current day is 7 larger than the written amount....

need the way to put Date in Parse.com without Time and the opposite


android,date,time,parse.com
Can't figured how to put just Date or just Time to Parse.com. Even after SimpleDateFormat the Date objects transferring with full default missing data. Code samples: DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); DateFormat timeFormat = new SimpleDateFormat("HH:mm"); try { date = dateFormat.parse(mDate.getText().toString()); time = timeFormat.parse(mTime.getText().toString()); } catch (java.text.ParseException e) { ......

String check incorrectly returning true


batch-file
So I have been playing around in batch trying to make a simple batch game. So now what have I done wrong? Here is the code: :promotions_sucessful cls if %division%==Bronze V ( set league=Bronze IV set lp=0 echo You have been promoted! del promotion.txt pause>nul goto menu ) if %division%==Bronze...

Is timezone info redundant provided that UTC timestamp is available?


datetime,time,timezone,timestamp,timestamp-with-timezone
I have a simple mobile app that schedules future events between people at a specified location. These events may be physical or virtual, so the time specified for the event may or may not be in the same timezone as the 'location' of the event. For example, a physical meeting...