Is there a way to use VBA code to open a .bat file?
Is there a way to use VBA code to open a .bat file?
Something like:
![]()
Sub Belfry() x = Shell("cmd.exe /c C:\TestFolder\sample.bat", 1) End Sub
Gary's Student
The file path leads onto the m drive. Should I change it to "cmd.exe/m" instead? This doesn't execute it either, but it is opening the command window permanently.
![]()
Sub Belfry() x = Shell("cmd.exe /c M:\My Folder\Karen Postiglioni\JP\CSV Files\salesforce.com\Apex Data Loader 22.0\cliq_process\Update_Test_FNMA.bat", 1) End Sub
The file path leads onto the m drive. Should I change it to "cmd.exe/m" instead? This doesn't execute it either, but it is opening the command window permanently.
![]()
Sub Belfry() x = Shell("cmd.exe /c M:\My Folder\Karen Postiglioni\JP\CSV Files\salesforce.com\Apex Data Loader 22.0\cliq_process\Update_Test_FNMA.bat", 1) End Sub
This is the error that I'm getting from the command line:
'![]()
\\DTSDC02\Dignified\jsick\My Documents' CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory. Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.
It is quickly opening and closing the command window but it does not seem to be executing the bat file. When I double click it, it works fine. Any more ideas?
Actually the code needed was much simpler. For some reason this works:
![]()
shell "M\whatever\path\youwant\FILENAME.bat"
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks