Click here to Skip to main content
14,029,821 members

Free Tools

This forum is for discussing and recommending Free tools for software development. Please post direct links to tools, and not just links to pages that review or list tools.No shareware and no commercial products allowed. Please report spammers by voting to remove their messages and reporting their accounts.

 
GeneralAdobe Scan turns your documents, receipts & more into editable PDFs Pin
Kent Sharkey1-Jun-17 9:18
staffKent Sharkey1-Jun-17 9:18 
GeneralEXIFTOOL Pin
RedDk25-May-17 10:21
memberRedDk25-May-17 10:21 
GeneralRe: EXIFTOOL Pin
Richard MacCutchan25-May-17 21:00
protectorRichard MacCutchan25-May-17 21:00 
GeneralRe: EXIFTOOL Pin
Michael Haephrati11-Jun-17 10:00
mvpMichael Haephrati11-Jun-17 10:00 
GeneralRe: EXIFTOOL Pin
Richard MacCutchan11-Jun-17 21:45
protectorRichard MacCutchan11-Jun-17 21:45 
GeneralProgram to Play Wave File in Batch File, with Bonus for Programmers Pin
David A. Gray9-May-17 21:25
groupDavid A. Gray9-May-17 21:25 
GeneralRe: Program to Play Wave File in Batch File, with Bonus for Programmers Pin
Pat O'Brien31-Jul-17 10:02
memberPat O'Brien31-Jul-17 10:02 
GeneralRe: Program to Play Wave File in Batch File, with Bonus for Programmers Pin
David A. Gray29-May-18 11:03
groupDavid A. Gray29-May-18 11:03 
Though I could easily have implemented it as a Visual Basic script, I prefer a compiled EXE because its use does not depend upon a working Visual Basic Scripting interpreter, which is not a given in some locked down environments.

Nevertheless, for fun, below is my improved implementation, which took maybe an hour to cobble together and test.
<pre lang="vb">
Option Explicit

' ============================================================================
'
' Script Name: SoundOff.VBS
'
' Objective: Cause a shell script to play a sound file to completion.
'
' Command Arguments: SoundFileName = Name of sound file to play
'
' Remarks: This script is a port of SountOff.exe.
'
' ----------------------------------------------------------------------------
' Revision History
' ----------------------------------------------------------------------------
'
' Date By Synopsis
' ---------- --- -------------------------------------------------------------
' 2018/05/28 DAG Script created, tested, and deployed
' ============================================================================

const ARGS_NONE = 0
const ARRAY_FIRST_ELEMENT = 0

const ERROR_SUCCESS = 0 ' The status code variable is initialized with the standard Windows "success" status code.
const ERROR_NEEDS_CSCRIPT = 1 ' Status code 1 is reserved for scripts run in Wscript that require CScript.
const ERROR_NO_ARGS = 2 ' Status code 2 is reserved for scripts that require one or more command line arguments to report being called without any.
const ERROR_FILE_NOT_FOUND = 3

const SLEEP_TIME_100_MILISECS = 100
const WMP_PLAY_STATE_STOPPED = 1

dim intExitCode : intExitCode = ERROR_SUCCESS ' Anticipate success.
dim oArgs : Set oArgs = WScript.Arguments
dim iArgLast : iArgLast = oArgs.Count

if iArgLast > ARGS_NONE then
dim sFileSpec : sFileSpec = oArgs ( ARRAY_FIRST_ELEMENT )
dim oFSO : set oFSO                 = CreateObject ( "Scripting.FileSystemObject" )

if oFSO.FileExists ( sFileSpec ) then
dim oPlayer : Set oPlayer = CreateObject ( "WMPlayer.OCX" )
oPlayer.URL = sFileSpec ' Define the location / name of the file.
oPlayer.controls.play

While oPlayer.playState <> WMP_PLAY_STATE_STOPPED
WScript.Sleep SLEEP_TIME_100_MILISECS
Wend ' While oPlayer.playState <> WMP_PLAY_STATE_STOPPED

oPlayer.close ' Release the audio file.
else
intExitCode = ReportFileNotFound ( sFileSpec )
end if ' if oFSO.FileExists ( sFileSpec ) then
else
intExitCode = ShowSyntax ( )
end if ' if iArgLast > ARGS_NONE then

WScript.Quit ( intExitCode )

function ReportFileNotFound ( psFileSpec )

' ------------------------------------------------------------------------
'
' Function Name: ReportFileNotFound
'
' Synopsis: Display brief instructions about the syntax, and return
' a nonzero status code, which becomes the return value of
' the script.
'
' Arguments: psFileSpec = Name of file that cannot be found
'
' Returns: The return value is always ERROR_NO_ARGS.
'
' Remarks: This script displays its entire message at once, so that
' it behaves appropriately when run by WScript.exe. Since
' the script is otherwise silent, this adjustment of my
' standard practice permits it to run in either host.
' ------------------------------------------------------------------------

WScript.Echo Wscript.ScriptName & ": sound file " & psFileSpec & " cannot be found."
ShowSyntax = ERROR_FILE_NOT_FOUND

end function ' ReportFileNotFound

function ShowSyntax ( )

' ------------------------------------------------------------------------
'
' Function Name: ShowSyntax
'
' Synopsis: Display brief instructions about the syntax, and return
' a nonzero status code, which becomes the return value of
' the script.
'
' Arguments: None
'
' Returns: The return value is always ERROR_NO_ARGS.
'
' Remarks: This script displays its entire message at once, so that
' it behaves appropriately when run by WScript.exe. Since
' the script is otherwise silent, this adjustment of my
' standard practice permits it to run in either host.
' ------------------------------------------------------------------------

WScript.Echo "Usage: " & Wscript.ScriptName & " SoundFileName" & vbNewLine & vbNewLine & "where SoundFileName = Name of sound file to play"
ShowSyntax = ERROR_NO_ARGS

end function ' ShowSyntax
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting

GeneralAnybody know of a free font that has the barycenter symbol? Pin
swampwiz7-Apr-17 9:43
memberswampwiz7-Apr-17 9:43 
GeneralRe: Anybody know of a free font that has the barycenter symbol? Pin
Vinod Jangle7-Apr-17 10:02
memberVinod Jangle7-Apr-17 10:02 
Generalfreeware registry app: RegOwnershipEx 1.0.0.2 (new version) Pin
BillWoodruff30-Mar-17 23:53
mveBillWoodruff30-Mar-17 23:53 
GeneralIntroducing MluSmartEdit Pin
MCSIDevelopers25-Mar-17 3:59
memberMCSIDevelopers25-Mar-17 3:59 
GeneralFree PDF Diff Tools Pin
Bassam Abdul-Baki23-Mar-17 4:55
professionalBassam Abdul-Baki23-Mar-17 4:55 
GeneralFormat large Micro SD cards so Android and Windows can read them. Pin
OriginalGriff8-Feb-17 8:10
protectorOriginalGriff8-Feb-17 8:10 
GeneralVirtual box / Virtual machines Pin
Roberto64_Ge3-Feb-17 2:23
memberRoberto64_Ge3-Feb-17 2:23 
GeneralRe: Virtual box / Virtual machines Pin
Jochen Arndt3-Feb-17 3:03
mveJochen Arndt3-Feb-17 3:03 
General3 new tools Pin
Michael Haephrati30-Jan-17 12:01
mvpMichael Haephrati30-Jan-17 12:01 
GeneralA tool to display (and save to a file) all WiFi credentials Pin
Michael Haephrati8-Jan-17 8:15
mvpMichael Haephrati8-Jan-17 8:15 
GeneralA tool for converting TIF files into PDF Pin
Michael Haephrati6-Jan-17 0:33
mvpMichael Haephrati6-Jan-17 0:33 
GeneralxTracer.exe - terminal program for logging, filtering and analyzing traces on the fly Pin
Nikolay Khilyuk23-Dec-16 9:00
professionalNikolay Khilyuk23-Dec-16 9:00 
General.NET Profiler Pin
Super Lloyd6-Dec-16 0:01
memberSuper Lloyd6-Dec-16 0:01 
GeneralRe: .NET Profiler Pin
Richard Deeming6-Dec-16 2:15
mveRichard Deeming6-Dec-16 2:15 
GeneralRe: .NET Profiler Pin
Super Lloyd6-Dec-16 6:24
memberSuper Lloyd6-Dec-16 6:24 
NewsFree tool to sign executables Pin
Michael Haephrati4-Dec-16 7:15
mvpMichael Haephrati4-Dec-16 7:15 
GeneralRe: Free tool to sign executables Pin
Richard MacCutchan4-Dec-16 21:33
protectorRichard MacCutchan4-Dec-16 21:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190419.4 | Last Updated 23 Mar 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid