Originally posted by hariharanmca
Shell Command did work fine but doesn't now.
Collapse
X
-
Originally posted by NyNyHelpAre you saying to just hard code the batch file path in my code to test it? I don't really understand or are you just saying copy and paste the path and then the file name so you're sure its right?Comment
-
Originally posted by hariharanmcayes, don't hard code, for testing purpose just do it
I have and just did again and it still doesn't work. This I would say baffles me the most because I could understand if I was using an array and grabbing the filenames from the System.IO.Direc tory.GetFiles() command (which I am) and passing them to the Shell that maybe theres like garbage whitespace or something else messing up the path but when I put in for testing Shell("S:\TestF ile\batch1.bat" ) and it still states the file is not found I don't know what it could be.Comment
-
Well it seems that the folder I was trying to run the batch files from wasn't allowed to execute files. This is weird because our IT Tech gave me specific permissions to execute everywhere but whatever I just moved all my files to a folder where they run all there applications and I was able to execute the files there. I found this out by trying to execute from my local Documents folder (didn't work) but when I moved it to my programs folder it worked like a charm. So I want to thank you guys for your advice and time.
-JohnComment
-
Thanks for giving us the details on how it turned out. Not only was I curious, but this may be helpful for anyone who comes here with a similar problem in the future.
However, what I don't get is this. How come it did work when you used Explorer or the Start | Run command?Comment
-
Originally posted by NyNyHelpWell it seems that the folder I was trying to run the batch files from wasn't allowed to execute files. This is weird because our IT Tech gave me specific permissions to execute everywhere but whatever I just moved all my files to a folder where they run all there applications and I was able to execute the files there. I found this out by trying to execute from my local Documents folder (didn't work) but when I moved it to my programs folder it worked like a charm. So I want to thank you guys for your advice and time.
-John
1. Wherever you open, some (.EXE and some other) programs create (.tmp) file in primary partition (C :\).
2. .Bat file will run, if your code does not create any file in the area, which is written protected by Admin.
3. If it’s able to run in IE or RUN command, then it should be run through .bat file which is triggered by VB code.
4. If you give, where you copy the program to run and where it wouldn’t run? (we can get proper solution).Comment
-
Originally posted by NyNyHelpI was able to run the files in my program files folder and on a application server. But I could not run them in the my documents folder or shared servers.Comment
-
Originally posted by NyNyHelpI was able to run the files in my program files folder and on a application server. But I could not run them in the my documents folder or shared servers.
From what you told us, you could run them from wherever, but your program couldn't. Are you saying this is not the case? That's why I said to take the commad your program was issuing, and paste it into the "Run..." dialogue - to make sure we were talking about the same thing in each case.Comment
-
Originally posted by DeonI am having the same problem. However I have full access to the directory where the bat file is stored. It also worked a couple of days ago. I have moved the bat file to various locations but no luck. Frustrating....Comment
Comment