rottenrogue
New Member
Hi Guys,
I am looking for a macro that will play with .bat file(shortcut of that .bat file)
vba macro will be placed in macro.xlsm
I have a .bat file & i created a shortcut of that .bat file & we have to play with the shortcut of .bat file & that shortcut of .bat file is located at (when i clicked on properties i got target "C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle\9.15\Files\Close Excel.bat" & start in C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle\9.15\Files)
First Check shortcut of the .bat file is located or not & if it is located then move that shortcut of .bat file to C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle & run the .bat File
& If the .bat file is not located then do nothing
Thnx
I am looking for a vba macro
By seraching on google & as per my condition i tried to modify the macro but i am not getting the correct macro
plz see, I think this macro needs a correction plz correct the macro & help me in solving this problem Sir
https://www.excelforum.com/excel-pr...ut-i-e-lnk-file-by-vba-macro.html#post5378034
I am looking for a macro that will play with .bat file(shortcut of that .bat file)
vba macro will be placed in macro.xlsm
I have a .bat file & i created a shortcut of that .bat file & we have to play with the shortcut of .bat file & that shortcut of .bat file is located at (when i clicked on properties i got target "C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle\9.15\Files\Close Excel.bat" & start in C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle\9.15\Files)
First Check shortcut of the .bat file is located or not & if it is located then move that shortcut of .bat file to C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle & run the .bat File
& If the .bat file is not located then do nothing
Thnx
I am looking for a vba macro
Code:
Public Declare PtrSafe Function ShellExecute _
Lib "shell32.dll" _
Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long
Sub FFF()
Dim strFileName As String
Dim strFileExists As String
strFileName = "C:\Users\WolfieeeStyle\Desktop\Close Excel.lnk"
strFileExists = Dir(strFileName)
If strFileExists = "" Then
Set FSO = CreateObject("scripting.filesystemobject")
FSO.MoveFile Source:="C:\Users\WolfieeeStyle\Desktop\Close Excel.lnk", Destination:="C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle\9.15\"
ShellExecute 0, "OPEN", "C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle\9.15\Close Excel.lnk", "", "", 1
Else
End If
End Sub
By seraching on google & as per my condition i tried to modify the macro but i am not getting the correct macro
plz see, I think this macro needs a correction plz correct the macro & help me in solving this problem Sir
https://www.excelforum.com/excel-pr...ut-i-e-lnk-file-by-vba-macro.html#post5378034