Run a .bat file based on user input
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
I want to run a .bat file using Run command to delete a file. I have a list box with two inputs: File 1 and File 2. If user selects File 1, then the .bat file needs to delete File 1. If user selects File 2, then .bat file needs to delete File 2. If user selects both files, then both files need to be deleted. If user selects nothing, then no files are deleted. How do I dynamically delete files based on user selection? Much appreciate your help.
Thanks,
Sri.
Solved! Go to Solution.
- Labels:
- Run Command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for this solution. It works beautifully when user selects a file from the list box for deletion.
In some instances, no file deletion is necessary. So user doesn't select anything on the list box. When this happens, I am getting an error message. How would I handle such scenarios?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This is super helpful. I was getting a different error message when no files were selected (see error message below). I realized it was running an empty bat file and hence throwing this error. I wrote a dummy command line "exit" to circumvent this issue. And it worked! Thank you very much...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for the accept mark. and nicely done!
