Showing posts with label batch. Show all posts
Showing posts with label batch. Show all posts

Sunday, October 28, 2012

Updated MP4 to MP3 Script



Wanted to add some metadata to the mp3 I created from mp4s.
so. But for some reason yet to be investigated windows 8 cant seem to find my metadata.
VLC is happy.


REM FORMAT REQ <name-nospace><space><minus><space><songname><.mp4ext>
REM EG 'coolkids - i like to rock.mp4'
for /f "tokens=1,* delims=-" %%a in ('dir *.mp4 /b') do (call :makemusic %%a "%%b")
goto :eof

:makemusic
set str=%2%
set artist=%1%
REM %str:~2,-5% is used to strip the quotemarks and filename
set title=%str:~2,-5%

REM UPDATE WITH YOUR CORRECT PATH TO FFMPEG
G:\music\ffmpeg.exe -i "%1 - %title%.mp4" -vn -ar 44100 -ac 2 -ab 192000 -f mp3 -metadata title="%title%" -metadata artist="%artist%" "%1 - %title%.mp3"
REM <need command that will allow normalise the sound levels> :eof


Tuesday, April 5, 2011

Log Off Terminal Server Session from a Command Prompt on based username

This script base command to clear user off a server based on username, for this to work we need to determine the session id that is required by the logoff command.

How it works :
Use the 'For' loop to search work thru the list of users on the server
Then once it has found the user then execute a logoff command

Notes:
There are 2 cases as the qwinsta doesn't display the formating the same for
disconnected sessions & active sesssions.



REM @echo off
Set servername=citrix123
Set targetname=testuser1

REM For disconnected users
for /F "tokens=1,2,3" %%i in ('qwinsta %targetname% /Server:%servername%') do if %targetname%==%%j logoff %%k /server:%servername%
REM For active users
for /F "tokens=1,2,3" %%i in ('qwinsta %targetname% /Server:%servername%') do if %targetname%==%%i logoff %%j /server:%servername%