Execute command-line action from within Access

GrandMasterTuck

In need of medication
Local time
Today, 11:22
Joined
May 4, 2013
Messages
129
I have another thread in regards to being unable to get Access to run a batch file. The batch file has exactly one line of code. Is there a way, instead of trying to get Access to run the batch file, to run the line of code that's IN the batch file directly from within Access?

Here's the line of code in the batch file:
Code:
convert C:\APic\1.jpg -resize 240x300 C:\APic\1.jpg

It's using the ImageMagick application to perform this action. When I open a command prompt and type this exact thing, it works flawlessly. When I create a batch file with just this line of code and then save and execute the batch file by double-clicking it, it works flawlessly. But for the confounded LIFE of me, I can NOT get Access to run this batch file!

So, is there an Access / VBA command that will execute a line of code just as a command prompt will, so I don't even have to try and figure out why my batch file won't open?

This is making me really frustrated....
 
Please note that this is a double-post - two threads on the same question, essentially. While this doesn't disqualify you from getting help, it certainly will turn off some folks. Please remember that this practice is not popular on the forum as it makes you seem excessively impatient. By the way, I answered the other thread with a suggestion to attempt, so you DID get some attention.
 
Okay, sorry about that. But the question still stands (even though my other post, the one you classify as a 'double-post' to this one, has been solved): Can you run command line instructions from within Access without doing it by calling a batch file?
 
Any command that could be executed from the CMD prompt probably can be executed, but as noted in the other post, you might have to be concerned about making NO assumptions regarding whether the system can find your command if it is not in the default programs path. Further, if the single command is conditional, it will not have proper context in which to make a decision/test.
 

Users who are viewing this thread

Back
Top Bottom