tag:blogger.com,1999:blog-10221735.post1729794737981265048..comments2023-05-19T02:26:58.866-07:00Comments on Mitchell Data Base: Batch FilesBill Mitchellhttp://www.blogger.com/profile/04373828339706140353noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-10221735.post-18650888794213749922008-07-30T16:31:00.000-07:002008-07-30T16:31:00.000-07:00It needs to be on the C: drive,C:\Autoexec.batit i...It needs to be on the C: drive,<BR/><BR/>C:\Autoexec.bat<BR/><BR/>it is not case-sensitive.Bill Mitchellhttps://www.blogger.com/profile/04373828339706140353noreply@blogger.comtag:blogger.com,1999:blog-10221735.post-14819828692312093042008-07-30T10:02:00.000-07:002008-07-30T10:02:00.000-07:00Thanks Bill. Do I place it on c:\ or does it have ...Thanks Bill. Do I place it on c:\ or does it have to be put in a particular folder?grovellihttps://www.blogger.com/profile/01864327852651903204noreply@blogger.comtag:blogger.com,1999:blog-10221735.post-87129163550692785262008-07-30T07:14:00.000-07:002008-07-30T07:14:00.000-07:00That's very interesting. I've looked at four XP ma...That's very interesting. I've looked at four XP machines, three had it but one did not.<BR/><BR/>You'll just have to create the file youself.Bill Mitchellhttps://www.blogger.com/profile/04373828339706140353noreply@blogger.comtag:blogger.com,1999:blog-10221735.post-91283238278470648602008-07-29T07:36:00.000-07:002008-07-29T07:36:00.000-07:00Thanks again, I've tried searching for Autoexec.ba...Thanks again, I've tried searching for Autoexec.bat on my hard drive, with the options for hidden and system files and folders enabled to no avail.grovellihttps://www.blogger.com/profile/01864327852651903204noreply@blogger.comtag:blogger.com,1999:blog-10221735.post-59773154822212731492008-07-29T04:33:00.000-07:002008-07-29T04:33:00.000-07:00Look at the post by "Sir Loin" at http://www.vbfor...Look at the post by "Sir Loin" at http://www.vbforums.com/showthread.php?t=340769 it shows how to use FindWindowA to find a window. Your VBA could use that function to find the batch window and then loop until it closes. Don't forget to put a DoEvents in your loop code.<BR/><BR/>In XP, autoexec.bat is usually an empty zero-byte file but you can just edit with NotePad to put the SUBST statement inBill Mitchellhttps://www.blogger.com/profile/04373828339706140353noreply@blogger.comtag:blogger.com,1999:blog-10221735.post-51990206469668683512008-07-29T03:00:00.000-07:002008-07-29T03:00:00.000-07:00Also(if you don't mind :-)), with reference to...Also(if you don't mind :-)), with reference to your http://www.wvmitchell.com/tips/Network%20-%20simulating%20a%20network%20drive.htm<BR/>How can you achieve that in XP?<BR/>I've tried Start > Run > GPEDIT.MSC<BR/>Computer Configuration > Windows Settings > Scripts (Startup/Shutdown)<BR/>but I don't see how to edit the Autoexec file in there.grovellihttps://www.blogger.com/profile/01864327852651903204noreply@blogger.comtag:blogger.com,1999:blog-10221735.post-32783545554573803352008-07-28T23:47:00.000-07:002008-07-28T23:47:00.000-07:00Thanks Bill, do you already have a link to such Wi...Thanks Bill, do you already have a link to such Windows API call?grovellihttps://www.blogger.com/profile/01864327852651903204noreply@blogger.comtag:blogger.com,1999:blog-10221735.post-73638159438470976852008-07-28T16:42:00.000-07:002008-07-28T16:42:00.000-07:00Yes, you can run batch files from VBA using someth...Yes, you can run batch files from VBA using something like this:<BR/><BR/>Dim s As String<BR/>s = "cmd.exe /c C:\BILL\MyBatch.bat"<BR/>Shell s, vbNormalFocus<BR/><BR/>but VBA won't wait. I think you'd have to use a Windows API call to look for the "cmd" title bar, and loop until it closes.Bill Mitchellhttps://www.blogger.com/profile/04373828339706140353noreply@blogger.comtag:blogger.com,1999:blog-10221735.post-63345831420236346652008-07-28T13:52:00.000-07:002008-07-28T13:52:00.000-07:00Hi Bill, can you run batch files from within a VBA...Hi Bill, can you run batch files from within a VBA routine? If so, does the execution of the VBA code stop until the batch file has run all its instructions?grovellihttps://www.blogger.com/profile/01864327852651903204noreply@blogger.com