Calling Exe in Asp

Discussion in 'ASP General' started by Vinod, Feb 22, 2005.

  1. Vinod

    Vinod Guest

    Hi Steven,

    I will explain the scenario, when i run my exe from dos prompt it
    works fine.The end result of the exe is to
    convert all the files in the folder to encrypted file.The exe works
    fine.

    When i call this exe thru asp program.Its not showing the desired
    results ie the files are still in the same format its not encrypted.

    I used the following method

    Set server_shell = Server.CreateObject("wscript.shell")
    server_shell.Run "%comspec% /c c:\test\encrypt.exe"

    There is no error coming after the execution of the above.

    Regards
    Vinod


    "Steven Burn" <> wrote in message
    news:%23$...
    > Can you define "it's not working fine"?? (e.g. what IS happening?)
    >
    > --
    > Regards
    >
    > Steven Burn
    > Ur I.T. Mate Group
    > www.it-mate.co.uk
    >
    > Keeping it FREE!
    >
    > "Vinod" <> wrote in message
    > news:#...
    > > Hi,
    > > I have a problem, i am calling an exe from asp program. Its not working
    > > fine.
    > > When i execute the exe through the dos program directly i get the

    desired
    > > result.
    > > My exe will convert files in the folder to encrypted files.
    > >
    > > But when i call it thru asp program its not working fine. I have tried

    the
    > > following method.
    > >
    > > a) Calling the exe through shell program.
    > > b) Calling the exe through ASPEXEC.
    > > c) Calling the exe through the Batch Files.
    > >
    > > I would like to know your suggestions.
    > >
    > >
    > > Regards
    > > Vinod
    > >
    > >
    > >

    >
    >
    Vinod, Feb 22, 2005
    #1
    1. Advertising

  2. Vinod

    Vinod Guest

    The files will be wmv files.The path can be specified as an argument.
    Its not a downloadable utility. It resides in a folder in the server and i
    will invoke it thru my asp program.


    Or
    If it is a downloadable utility it will display the popup message
    (open,save), is there a way around so that it will by default will open and
    i wont see
    this popup.


    Regards
    Vinod




    "McKirahan" <> wrote in message
    news:...
    > "Vinod" <> wrote in message
    > news:...
    > > Hi Steven,
    > >
    > > I will explain the scenario, when i run my exe from dos prompt

    it
    > > works fine.The end result of the exe is to
    > > convert all the files in the folder to encrypted file.The exe

    > works
    > > fine.
    > >
    > > When i call this exe thru asp program.Its not showing the

    desired
    > > results ie the files are still in the same format its not encrypted.
    > >
    > > I used the following method
    > >
    > > Set server_shell = Server.CreateObject("wscript.shell")
    > > server_shell.Run "%comspec% /c c:\test\encrypt.exe"
    > >
    > > There is no error coming after the execution of the above.
    > >
    > > Regards
    > > Vinod

    >
    > [snip]
    >
    > Where are the files?
    > Are they also in "c:\test\"?
    > Or can you specify a path as an argument?
    > Is "encrypt.exe" a downloadable utility?
    >
    >
    >
    Vinod, Feb 22, 2005
    #2
    1. Advertising

  3. Vinod

    Vinod Guest

    Hi,
    I have a problem, i am calling an exe from asp program. Its not working
    fine.
    When i execute the exe through the dos program directly i get the desired
    result.
    My exe will convert files in the folder to encrypted files.

    But when i call it thru asp program its not working fine. I have tried the
    following method.

    a) Calling the exe through shell program.
    b) Calling the exe through ASPEXEC.
    c) Calling the exe through the Batch Files.

    I would like to know your suggestions.


    Regards
    Vinod
    Vinod, Feb 22, 2005
    #3
  4. Vinod

    Steven Burn Guest

    Can you define "it's not working fine"?? (e.g. what IS happening?)

    --
    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    "Vinod" <> wrote in message
    news:#...
    > Hi,
    > I have a problem, i am calling an exe from asp program. Its not working
    > fine.
    > When i execute the exe through the dos program directly i get the desired
    > result.
    > My exe will convert files in the folder to encrypted files.
    >
    > But when i call it thru asp program its not working fine. I have tried the
    > following method.
    >
    > a) Calling the exe through shell program.
    > b) Calling the exe through ASPEXEC.
    > c) Calling the exe through the Batch Files.
    >
    > I would like to know your suggestions.
    >
    >
    > Regards
    > Vinod
    >
    >
    >
    Steven Burn, Feb 22, 2005
    #4
  5. Vinod

    Roland Hall Guest

    "Vinod" wrote in message news:%...
    : I have a problem, i am calling an exe from asp program. Its not working
    : fine.
    : When i execute the exe through the dos program directly i get the desired
    : result.
    A single tasking mode app that only uses real memory?

    : My exe will convert files in the folder to encrypted files.
    What type?

    : But when i call it thru asp program its not working fine. I have tried the
    : following method.
    Fine is relative.

    : a) Calling the exe through shell program.
    : b) Calling the exe through ASPEXEC.
    : c) Calling the exe through the Batch Files.
    :
    : I would like to know your suggestions.

    With all the calling you've probably run over on your minutes. It's peak
    hours and you could be roaming. My suggestion is wait until after 9pm and
    try again or display the errors you are getting with the processes you are
    trying.

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Feb 22, 2005
    #5
  6. Vinod

    Vinod Guest

    "McKirahan" <> wrote in message
    news:...
    > "Vinod" <> wrote in message
    > news:...
    > > The files will be wmv files.The path can be specified as an argument.
    > > Its not a downloadable utility. It resides in a folder in the server and

    i
    > > will invoke it thru my asp program.
    > >
    > >
    > > Or
    > > If it is a downloadable utility it will display the popup

    message
    > > (open,save), is there a way around so that it will by default will open

    > and
    > > i wont see
    > > this popup.
    > >
    > >
    > > Regards
    > > Vinod

    >
    > [snip]
    >
    > Set server_shell = Server.CreateObject("wscript.shell")
    > server_shell.Run "%comspec% /c c:\test\encrypt.exe"
    >
    > Is the code you posted (above) the code you run or just an example?
    >
    > It doesn't include a path to your ".wmv" files?
    >
    > When you specify a path make sure that it's relative to your Web root.
    >
    > Also, I was asking where can I download this utility to test it.
    >
    > (Please do not top post.)
    >
    >



    Hi,

    The code i posted above is just an example only small changes is there. I
    will say the full code will look like this

    Set server_shell = Server.CreateObject("wscript.shell")
    server_shell.Run "%comspec% /c c:\test\encrypt.exe c:\test\"

    The first parameter will be the folder name and the second parameter will be
    the location of wmv files.

    See my exe will be present in the server and the files will also reside in
    the server, i will change the location of the files dynamically thru the
    program.

    If you can suggest me any place i will upload it there.

    Regards
    Vinod
    Vinod, Feb 23, 2005
    #6
  7. Vinod

    McKirahan Guest

    "Vinod" <> wrote in message
    news:...
    > Hi Steven,
    >
    > I will explain the scenario, when i run my exe from dos prompt it
    > works fine.The end result of the exe is to
    > convert all the files in the folder to encrypted file.The exe

    works
    > fine.
    >
    > When i call this exe thru asp program.Its not showing the desired
    > results ie the files are still in the same format its not encrypted.
    >
    > I used the following method
    >
    > Set server_shell = Server.CreateObject("wscript.shell")
    > server_shell.Run "%comspec% /c c:\test\encrypt.exe"
    >
    > There is no error coming after the execution of the above.
    >
    > Regards
    > Vinod


    [snip]

    Where are the files?
    Are they also in "c:\test\"?
    Or can you specify a path as an argument?
    Is "encrypt.exe" a downloadable utility?
    McKirahan, Feb 23, 2005
    #7
  8. Vinod

    McKirahan Guest

    "Vinod" <> wrote in message
    news:...
    > The files will be wmv files.The path can be specified as an argument.
    > Its not a downloadable utility. It resides in a folder in the server and i
    > will invoke it thru my asp program.
    >
    >
    > Or
    > If it is a downloadable utility it will display the popup message
    > (open,save), is there a way around so that it will by default will open

    and
    > i wont see
    > this popup.
    >
    >
    > Regards
    > Vinod


    [snip]

    Set server_shell = Server.CreateObject("wscript.shell")
    server_shell.Run "%comspec% /c c:\test\encrypt.exe"

    Is the code you posted (above) the code you run or just an example?

    It doesn't include a path to your ".wmv" files?

    When you specify a path make sure that it's relative to your Web root.

    Also, I was asking where can I download this utility to test it.

    (Please do not top post.)
    McKirahan, Feb 23, 2005
    #8
  9. Vinod

    Sune Guest

    > a) Calling the exe through shell program.
    > b) Calling the exe through ASPEXEC.
    > c) Calling the exe through the Batch Files.

    Hi,
    I'm going to tag along at this thread - dealing with the same problem as
    you at the moment.
    I have a some .bat files generating .txt files with pings and traceroutes
    to certain hosts, and i need to call these .bat files from asp.
    I have tried with wscript.shell and AspExec, and also i am not getting any
    errors but the files aren't getting executed
    I have tried assigning iusr_servername permissions on both tracert.exe, ping.exe,
    cmd.exe and the .bat files.

    The script combinations i have tried are the following, and the fiels works
    fine when calling them manually on the server:


    set wshell = server.createobject("wscript.shell")
    wshell.Run "cmd.exe /c c:\Inetpub\wwwroot\scripts\script.bat"
    set wshell = nothing

    set wshell = server.createobject("wscript.shell")
    Response.write wshell.run("c:\Inetpub\wwwroot\scripts\script.bat")
    set wshell = nothing

    Set Executor = Server.CreateObject("ASPExec.Execute")
    Executor.Application = "c:\Inetpub\wwwroot\scripts\script.bat"
    Executor.TimeOut = 10000
    Executor.ShowWindow = False
    Executor.ExecuteWinApp

    Set Executor = Server.CreateObject("ASPExec.Execute")
    Executor.Application = "cmd.exe"
    Executor.Parameters = "/c c:\Inetpub\wwwroot\scripts\script.bat"
    Executor.TimeOut = 10000
    Executor.ShowWindow = False
    Executor.ExecuteWinApp


    I have tried with executing as DosApp too and with ShowWindows = True, without
    any luck.
    I tried the AspExec example tracerouting too, however this didnt work until
    i gave iusr_servername permissions at tracert.exe - but which permissions
    can be missing when it still aint working in my bat files? they look like
    this:


    ping -a cnn.com > c:\Inetpub\wwwroot\data\ping.txt
    tracert cnn.com > c:\Inetpub\wwwroot\data\traceroute.txt


    Could it perhaps be something that denies the bat file to write the textfiles?
    I have assigned writing permissions for iusr_servername too, but is there
    any application i am missing to assign them to?
    And is there anything that i could add to the .bat file so that i could see
    if it's even being executed or not?
    --
    Regards,
    Sune
    Sune, Feb 24, 2005
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Namratha Shah \(Nasha\)
    Replies:
    0
    Views:
    4,680
    Namratha Shah \(Nasha\)
    Nov 5, 2004
  2. Chitra

    ASPnet_wp.exe and CSRSS.exe

    Chitra, Nov 7, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    429
    Chitra
    Nov 7, 2003
  3. Id L
    Replies:
    2
    Views:
    4,773
    mikeb
    Mar 3, 2004
  4. Earl
    Replies:
    2
    Views:
    106
  5. Friends
    Replies:
    1
    Views:
    286
    Bob Barrows [MVP]
    Sep 23, 2005
Loading...

Share This Page