Problem calling batch file in ASP
-
Hey all, Im trying to call a batch file in ASP but everytime i try it i get an error 'Object Expected'. Here is the code in question: <% function myFunction() set objShell = server.CreateObject("WScript.Shell") intStatus = objShell.Run("c:\inetpub\wwwroot\Test\some.cmd", 0, true) end function %>
Does this look right or have I totally missed/messed something?
-
Hey all, Im trying to call a batch file in ASP but everytime i try it i get an error 'Object Expected'. Here is the code in question: <% function myFunction() set objShell = server.CreateObject("WScript.Shell") intStatus = objShell.Run("c:\inetpub\wwwroot\Test\some.cmd", 0, true) end function %>
Does this look right or have I totally missed/messed something?
-
You totally missed something im afraid; server-side functions cannot be called from client side buttons. You must submit a request to the server and then execute your function.
There are some serious issues with users here not understanding the scope of code execution, variables, and the differences between client side processes and server side processes :)
'Cause I'm living on things that excite me, be it pastries or lobsters or love...
I'm just trying to get by, being quiet and shy, in a world full of push and shove... Jimmy Buffett - The Wino and I know