I would like to run a file, in cmd without knowing the type (e.g. JPG, mp3, txt, mp4 and etc).
I tried to use 'start' command, but start (as far I found) need to know the full name of the file (with extension) and which program it should use to run it (e.g. VLC, notepad, photo viewer).
So, for example, instead of using C:\AI>start "VLC media player" "Bernard.avi" I want something like C:\AI>start "Bernard" to work similar.
cmd, Open file in Command Prompt shell without knowing its extension
1.6k Views Asked by Z.A.M At
2
There are 2 best solutions below
Related Questions in WINDOWS
- Get Maximum Log Size
- Debugging Windows Services while starting
- Possible consequences of duplicate ProgId for different classes
- How to chain BCryptEncrypt and BCryptDecrypt calls using AES in GCM mode?
- mingw-64 conflicting declarations when cross-compiling
- I run an EXE program from a Windows Service but I can't see form C#?
- Why is PowerShell "not recognized" when installing Chocolatey?
- How to check if Windows device is phone or tablet/pc?
- How to add directories to Cygwin gcc default search path
- Can't install anything with pip2 on Windows 7 due to UnicodeDecodeError
- Active directory and linux nslcd binding without extending the AD schema
- How To Prevent Over Scrolling in Scroll Viewer Windows Phone 8.1
- Unicode error from pip install
- Where is the 'EnablePinning' property in the ribbon framework's recent items?
- How can I implement the same models and data across ASP.NET and Windows Apps
Related Questions in CMD
- Execute a command over multiple files
- R CMD recognize only some commands
- FIle download via cmd in windows using HTML
- CMD/BATCH - Had to run batch script 3 times to get full result
- Lauching program via command in php
- CMD specifying columns to save?
- Set environment in current cmd using batch script
- Running a powershell command inside cmd script and replacing string content
- Is it possible to close every application via a batch file?
- Implementing timed input in batch file. (countdown to a minute)
- How to remove "Remote desktop disconnected" window and close mstsc.exe
- Extracting specific registry key from REG QUERY based on search string
- Blank path in environment variable causing elevated command prompt to not respond
- CMD - Takeown giving "The data area passed to a system call is too small"
- Compare 2 text files and display the difference between them (PowerShell or CMD)
Related Questions in COMMAND-PROMPT
- Java jar File error message Exception in thread "AWT-EventQueue-0"
- Create text file using echo in command prompt
- Del command in command prompt
- Application logs on the command prompt from where application is being launched
- Script runs fine in ISE but fails from Command Prompt
- Alert on operation completion in windows cmd
- Can't run MySQL from command prompt
- Pass parameter value to sql file from batch file using batch command
- Calling HTML Help from command prompt with keyword
- Set Java path in command line for only one directory
- Communication between WinCE device and Windows PC over USB
- npm install error not installing BrowserSync package
- set the OpenSSL_HOME variable
- automate command prompt to copy file
- How can I hide command prompt in a VB program but also take an action?
Related Questions in EXPLORER
- Set folder display thumbnail in Explorer with C#
- How to enter an escape sequence when using ProcessBuilder to open Windows file explorer and highlight the file?
- How to end explorer.exe in Windows 8.1 (It restarts each time I do so)
- Eclipse file explorer not working with real device
- can't find file explorer in android studio
- Subclass Windows File Explorer
- Notify Windows Explorer that a wallpaper has been changed
- cmd, Open file in Command Prompt shell without knowing its extension
- How to copy attribute of svg graphic (from html to excel)
- Open file explorer at coordinates
- explorer and mozilla doesn't show website calendar
- Java Fx Drag and Drop to windows explorer - gestureTarget is always null / explorer should wait
- Error 500 launching the Web Service Explorer with Eclipse
- Visual Studio "Open as a Web Site" context menu option
- How to get F# scripts files and other script languages to work like .exe, .cmd, and .bat files in Windows
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
If you are sure only one file has that filename you use a for loop to search for the file like this:
In your example it would be:
You can put it in a batch-script:
and give the path to the filename without extension as argument (don't forget the surrounding double quotes).
If multiple files have that filename it will open them all.