I have a batch file that is save in a shared drive (S:
) and I am trying to use vbscripts createobject method to create a shell script to run my batch file. My current vbscript is:
<script language="VBScript">
Sub zeprint()
Dim oShell
Set oShell = WScript.CreateObject("WScript.Shell")
oShell.CurrentDirectory = "s:"
oShell.Run "s:\batprint.bat"
Set oShell = Nothing
End Sub
</script>
Then in some html I have, I created a button and set onclick="zeprint()"
.
I know the button works because I use to have it assigned to window.print();
.
I have been searching all over for the answer to this but cannot seem to figure out why it isn't working. The batch file also runs correctly when manually ran from the command prompt. This leads me to believe that it is a problem with the vbscript.
Any help would be appreciated.