ASP run command line

Discussion in 'ASP General' started by shank, Jan 6, 2006.

  1. shank

    shank Guest

    What is the proper syntax to run this command line in ASP?

    wzzip.exe File.zip File.txt

    thanks
    shank, Jan 6, 2006
    #1
    1. Advertising

  2. Dim oShell, sCommand
    sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\File.txt"
    Set oShell = Server.CreateObject("WScript.Shell")
    oShell.Run sCommand, , True
    Set oShell = Nothing

    Try that.

    Ray at work

    "shank" <> wrote in message
    news:%...
    > What is the proper syntax to run this command line in ASP?
    >
    > wzzip.exe File.zip File.txt
    >
    > thanks
    >
    Ray Costanzo [MVP], Jan 6, 2006
    #2
    1. Advertising

  3. shank

    shank Guest

    I'm not sure if this is a syntax issue or a WinZip issue. The code runs
    without error and these three files are created. The temp files are
    populated, but the ZIP file is empty. Any ideas?

    _Za04560 = 3,321 KB
    Stock.zip = 0 bytes
    WZ60.tmp = 3,321 KB

    If I use the START > Run - this command works without a probolem:
    wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    C:\Inetpub\wwwroot\shwholesale\db\*.dbf
    So that should tell me the command and paths are OK.

    <%
    Dim oShell, sCommand
    'sCommand = "wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    C:\Inetpub\wwwroot\shwholesale\db\*.dbf"
    sCommand = "wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    C:\Inetpub\wwwroot\shwholesale\db\*.dbf"
    Set oShell = Server.CreateObject("WScript.Shell")
    oShell.Run sCommand, , True
    Set oShell = Nothing
    %>
    thanks!
    -----------------------------------------------
    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > Dim oShell, sCommand
    > sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\File.txt"
    > Set oShell = Server.CreateObject("WScript.Shell")
    > oShell.Run sCommand, , True
    > Set oShell = Nothing
    >
    > Try that.
    >
    > Ray at work
    >
    > "shank" <> wrote in message
    > news:%...
    >> What is the proper syntax to run this command line in ASP?
    >>
    >> wzzip.exe File.zip File.txt
    >>
    >> thanks
    >>

    >
    >
    shank, Jan 6, 2006
    #3
  4. Are those .dbf files in use by your page when you execute that script? Any
    open database connections or anything? Throw some test text files in that
    directory and try zipping those up to see what happens.

    Ray at work

    "shank" <> wrote in message
    news:%...
    > I'm not sure if this is a syntax issue or a WinZip issue. The code runs
    > without error and these three files are created. The temp files are
    > populated, but the ZIP file is empty. Any ideas?
    >
    > _Za04560 = 3,321 KB
    > Stock.zip = 0 bytes
    > WZ60.tmp = 3,321 KB
    >
    > If I use the START > Run - this command works without a probolem:
    > wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    > C:\Inetpub\wwwroot\shwholesale\db\*.dbf
    > So that should tell me the command and paths are OK.
    >
    > <%
    > Dim oShell, sCommand
    > 'sCommand = "wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    > C:\Inetpub\wwwroot\shwholesale\db\*.dbf"
    > sCommand = "wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    > C:\Inetpub\wwwroot\shwholesale\db\*.dbf"
    > Set oShell = Server.CreateObject("WScript.Shell")
    > oShell.Run sCommand, , True
    > Set oShell = Nothing
    > %>
    > thanks!
    > -----------------------------------------------
    > "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    > message news:...
    >> Dim oShell, sCommand
    >> sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\File.txt"
    >> Set oShell = Server.CreateObject("WScript.Shell")
    >> oShell.Run sCommand, , True
    >> Set oShell = Nothing
    >>
    >> Try that.
    >>
    >> Ray at work
    >>
    >> "shank" <> wrote in message
    >> news:%...
    >>> What is the proper syntax to run this command line in ASP?
    >>>
    >>> wzzip.exe File.zip File.txt
    >>>
    >>> thanks
    >>>

    >>
    >>

    >
    >
    Ray Costanzo [MVP], Jan 6, 2006
    #4
  5. shank

    shank Guest

    Yes they are DBF files, but there is no connection to them. They are just
    simple files. I can zip using the RUN dialog box with the below command, but
    when I stick the command in the code, all I get is the temp files and an
    empty zip file.
    thanks!


    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > Are those .dbf files in use by your page when you execute that script?
    > Any open database connections or anything? Throw some test text files in
    > that directory and try zipping those up to see what happens.
    >
    > Ray at work
    >
    > "shank" <> wrote in message
    > news:%...
    >> I'm not sure if this is a syntax issue or a WinZip issue. The code runs
    >> without error and these three files are created. The temp files are
    >> populated, but the ZIP file is empty. Any ideas?
    >>
    >> _Za04560 = 3,321 KB
    >> Stock.zip = 0 bytes
    >> WZ60.tmp = 3,321 KB
    >>
    >> If I use the START > Run - this command works without a probolem:
    >> wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    >> C:\Inetpub\wwwroot\shwholesale\db\*.dbf
    >> So that should tell me the command and paths are OK.
    >>
    >> <%
    >> Dim oShell, sCommand
    >> 'sCommand = "wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    >> C:\Inetpub\wwwroot\shwholesale\db\*.dbf"
    >> sCommand = "wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    >> C:\Inetpub\wwwroot\shwholesale\db\*.dbf"
    >> Set oShell = Server.CreateObject("WScript.Shell")
    >> oShell.Run sCommand, , True
    >> Set oShell = Nothing
    >> %>
    >> thanks!
    >> -----------------------------------------------
    >> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    >> message news:...
    >>> Dim oShell, sCommand
    >>> sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\File.txt"
    >>> Set oShell = Server.CreateObject("WScript.Shell")
    >>> oShell.Run sCommand, , True
    >>> Set oShell = Nothing
    >>>
    >>> Try that.
    >>>
    >>> Ray at work
    >>>
    >>> "shank" <> wrote in message
    >>> news:%...
    >>>> What is the proper syntax to run this command line in ASP?
    >>>>
    >>>> wzzip.exe File.zip File.txt
    >>>>
    >>>> thanks
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    shank, Jan 6, 2006
    #5
  6. You explained that in your previous post. Did you try testing it with text
    files?

    Ray at work

    "shank" <> wrote in message
    news:%...
    > Yes they are DBF files, but there is no connection to them. They are just
    > simple files. I can zip using the RUN dialog box with the below command,
    > but when I stick the command in the code, all I get is the temp files and
    > an empty zip file.
    > thanks!
    >
    >
    > "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    > message news:...
    >> Are those .dbf files in use by your page when you execute that script?
    >> Any open database connections or anything? Throw some test text files in
    >> that directory and try zipping those up to see what happens.
    >>
    >> Ray at work
    >>
    >> "shank" <> wrote in message
    >> news:%...
    >>> I'm not sure if this is a syntax issue or a WinZip issue. The code runs
    >>> without error and these three files are created. The temp files are
    >>> populated, but the ZIP file is empty. Any ideas?
    >>>
    >>> _Za04560 = 3,321 KB
    >>> Stock.zip = 0 bytes
    >>> WZ60.tmp = 3,321 KB
    >>>
    >>> If I use the START > Run - this command works without a probolem:
    >>> wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    >>> C:\Inetpub\wwwroot\shwholesale\db\*.dbf
    >>> So that should tell me the command and paths are OK.
    >>>
    >>> <%
    >>> Dim oShell, sCommand
    >>> 'sCommand = "wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    >>> C:\Inetpub\wwwroot\shwholesale\db\*.dbf"
    >>> sCommand = "wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    >>> C:\Inetpub\wwwroot\shwholesale\db\*.dbf"
    >>> Set oShell = Server.CreateObject("WScript.Shell")
    >>> oShell.Run sCommand, , True
    >>> Set oShell = Nothing
    >>> %>
    >>> thanks!
    >>> -----------------------------------------------
    >>> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    >>> message news:...
    >>>> Dim oShell, sCommand
    >>>> sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\File.txt"
    >>>> Set oShell = Server.CreateObject("WScript.Shell")
    >>>> oShell.Run sCommand, , True
    >>>> Set oShell = Nothing
    >>>>
    >>>> Try that.
    >>>>
    >>>> Ray at work
    >>>>
    >>>> "shank" <> wrote in message
    >>>> news:%...
    >>>>> What is the proper syntax to run this command line in ASP?
    >>>>>
    >>>>> wzzip.exe File.zip File.txt
    >>>>>
    >>>>> thanks
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    Ray Costanzo [MVP], Jan 6, 2006
    #6
  7. shank

    shank Guest

    I just tried it with 5 *.txt files. Same results. Two temp files that are
    populated and a ZIP file that's empty. Then I ran the command line in the
    RUN dialog and it grabbed all 5 text files and zipped them without a
    problem. So, same results.

    oShell.Run sCommand, , True
    What does the empty space between the commas mean?
    What does True mean?

    thanks!

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > You explained that in your previous post. Did you try testing it with
    > text files?
    >
    > Ray at work
    >
    > "shank" <> wrote in message
    > news:%...
    >> Yes they are DBF files, but there is no connection to them. They are just
    >> simple files. I can zip using the RUN dialog box with the below command,
    >> but when I stick the command in the code, all I get is the temp files and
    >> an empty zip file.
    >> thanks!
    >>
    >>
    >> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    >> message news:...
    >>> Are those .dbf files in use by your page when you execute that script?
    >>> Any open database connections or anything? Throw some test text files
    >>> in that directory and try zipping those up to see what happens.
    >>>
    >>> Ray at work
    >>>
    >>> "shank" <> wrote in message
    >>> news:%...
    >>>> I'm not sure if this is a syntax issue or a WinZip issue. The code runs
    >>>> without error and these three files are created. The temp files are
    >>>> populated, but the ZIP file is empty. Any ideas?
    >>>>
    >>>> _Za04560 = 3,321 KB
    >>>> Stock.zip = 0 bytes
    >>>> WZ60.tmp = 3,321 KB
    >>>>
    >>>> If I use the START > Run - this command works without a probolem:
    >>>> wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    >>>> C:\Inetpub\wwwroot\shwholesale\db\*.dbf
    >>>> So that should tell me the command and paths are OK.
    >>>>
    >>>> <%
    >>>> Dim oShell, sCommand
    >>>> 'sCommand = "wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    >>>> C:\Inetpub\wwwroot\shwholesale\db\*.dbf"
    >>>> sCommand = "wzzip.exe C:\Inetpub\wwwroot\shwholesale\db\shStock.zip
    >>>> C:\Inetpub\wwwroot\shwholesale\db\*.dbf"
    >>>> Set oShell = Server.CreateObject("WScript.Shell")
    >>>> oShell.Run sCommand, , True
    >>>> Set oShell = Nothing
    >>>> %>
    >>>> thanks!
    >>>> -----------------------------------------------
    >>>> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    >>>> message news:...
    >>>>> Dim oShell, sCommand
    >>>>> sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\File.txt"
    >>>>> Set oShell = Server.CreateObject("WScript.Shell")
    >>>>> oShell.Run sCommand, , True
    >>>>> Set oShell = Nothing
    >>>>>
    >>>>> Try that.
    >>>>>
    >>>>> Ray at work
    >>>>>
    >>>>> "shank" <> wrote in message
    >>>>> news:%...
    >>>>>> What is the proper syntax to run this command line in ASP?
    >>>>>>
    >>>>>> wzzip.exe File.zip File.txt
    >>>>>>
    >>>>>> thanks
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    shank, Jan 6, 2006
    #7
  8. Hi shank,

    The empty space should actually be a 0, although a space is okay to use.
    But, to be clear, best put a 0 in there. The true means that the script
    should wait for your executed command to finish before moving along.
    Download the WSH documentation here:
    http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9

    When I run the script in a .vbs file, it works fine. It also works in an
    ASP file where my IUSR account has full permissions on the directory in to
    which I'm writing the .zip file.

    My VBS file that I run:
    Dim oShell, sCommand
    sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\*.txt"
    Set oShell = CreateObject("WScript.Shell")
    oShell.Run sCommand, , True
    Set oShell = Nothing

    My ASP file:
    <%
    Dim oShell, sCommand
    sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\*.txt"
    Set oShell = CreateObject("WScript.Shell")
    oShell.Run sCommand, , True
    Set oShell = Nothing
    %>

    I'm using Winzip 10. Is your copy of Winzip registered?

    Ray at work

    As for your script, what kind of permissions does IUSR_[servername] have on
    the directory you're trying to zip your files in?
    "shank" <> wrote in message
    news:u$...
    >I just tried it with 5 *.txt files. Same results. Two temp files that are
    >populated and a ZIP file that's empty. Then I ran the command line in the
    >RUN dialog and it grabbed all 5 text files and zipped them without a
    >problem. So, same results.
    >
    > oShell.Run sCommand, , True
    > What does the empty space between the commas mean?
    > What does True mean?
    >
    > thanks!
    >
    > "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    > message news:...
    >> You explained that in your previous post. Did you try testing it with
    >> text files?
    >>
    >> Ray at work
    >>
    >> "shank" <> wrote in message
    >> news:%...
    >>> Yes they are DBF files, but there is no connection to them. They are
    >>> just simple files. I can zip using the RUN dialog box with the below
    >>> command, but when I stick the command in the code, all I get is the temp
    >>> files and an empty zip file.
    >>> thanks!
    Ray Costanzo [MVP], Jan 6, 2006
    #8
  9. shank

    shank Guest

    Yes I have the registered WinZip Pro version $59.99.
    My permissions look right and I have to assume they are correct.
    I can write the DBF files from one ASP page.
    Then the ASP zip page creates the temp zip files.
    That should cover read & writes.
    I need to trade a few emails with WinZip I think.
    thanks!


    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > Hi shank,
    >
    > The empty space should actually be a 0, although a space is okay to use.
    > But, to be clear, best put a 0 in there. The true means that the script
    > should wait for your executed command to finish before moving along.
    > Download the WSH documentation here:
    > http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9
    >
    > When I run the script in a .vbs file, it works fine. It also works in an
    > ASP file where my IUSR account has full permissions on the directory in to
    > which I'm writing the .zip file.
    >
    > My VBS file that I run:
    > Dim oShell, sCommand
    > sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\*.txt"
    > Set oShell = CreateObject("WScript.Shell")
    > oShell.Run sCommand, , True
    > Set oShell = Nothing
    >
    > My ASP file:
    > <%
    > Dim oShell, sCommand
    > sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\*.txt"
    > Set oShell = CreateObject("WScript.Shell")
    > oShell.Run sCommand, , True
    > Set oShell = Nothing
    > %>
    >
    > I'm using Winzip 10. Is your copy of Winzip registered?
    >
    > Ray at work
    >
    > As for your script, what kind of permissions does IUSR_[servername] have
    > on the directory you're trying to zip your files in?
    > "shank" <> wrote in message
    > news:u$...
    >>I just tried it with 5 *.txt files. Same results. Two temp files that are
    >>populated and a ZIP file that's empty. Then I ran the command line in the
    >>RUN dialog and it grabbed all 5 text files and zipped them without a
    >>problem. So, same results.
    >>
    >> oShell.Run sCommand, , True
    >> What does the empty space between the commas mean?
    >> What does True mean?
    >>
    >> thanks!
    >>
    >> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    >> message news:...
    >>> You explained that in your previous post. Did you try testing it with
    >>> text files?
    >>>
    >>> Ray at work
    >>>
    >>> "shank" <> wrote in message
    >>> news:%...
    >>>> Yes they are DBF files, but there is no connection to them. They are
    >>>> just simple files. I can zip using the RUN dialog box with the below
    >>>> command, but when I stick the command in the code, all I get is the
    >>>> temp files and an empty zip file.
    >>>> thanks!

    >
    >
    shank, Jan 6, 2006
    #9
  10. shank

    shank Guest

    I have found the problem. The WinZip is user based registration, not server
    based. They do not have a server version. It worked with the RUN box because
    I was logged in.
    thanks for your help!

    - - - - - - - - - - -


    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > Hi shank,
    >
    > The empty space should actually be a 0, although a space is okay to use.
    > But, to be clear, best put a 0 in there. The true means that the script
    > should wait for your executed command to finish before moving along.
    > Download the WSH documentation here:
    > http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9
    >
    > When I run the script in a .vbs file, it works fine. It also works in an
    > ASP file where my IUSR account has full permissions on the directory in to
    > which I'm writing the .zip file.
    >
    > My VBS file that I run:
    > Dim oShell, sCommand
    > sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\*.txt"
    > Set oShell = CreateObject("WScript.Shell")
    > oShell.Run sCommand, , True
    > Set oShell = Nothing
    >
    > My ASP file:
    > <%
    > Dim oShell, sCommand
    > sCommand = "wzzip.exe C:\Output\File.zip C:\SourceFiles\*.txt"
    > Set oShell = CreateObject("WScript.Shell")
    > oShell.Run sCommand, , True
    > Set oShell = Nothing
    > %>
    >
    > I'm using Winzip 10. Is your copy of Winzip registered?
    >
    > Ray at work
    >
    > As for your script, what kind of permissions does IUSR_[servername] have
    > on the directory you're trying to zip your files in?
    > "shank" <> wrote in message
    > news:u$...
    >>I just tried it with 5 *.txt files. Same results. Two temp files that are
    >>populated and a ZIP file that's empty. Then I ran the command line in the
    >>RUN dialog and it grabbed all 5 text files and zipped them without a
    >>problem. So, same results.
    >>
    >> oShell.Run sCommand, , True
    >> What does the empty space between the commas mean?
    >> What does True mean?
    >>
    >> thanks!
    >>
    >> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    >> message news:...
    >>> You explained that in your previous post. Did you try testing it with
    >>> text files?
    >>>
    >>> Ray at work
    >>>
    >>> "shank" <> wrote in message
    >>> news:%...
    >>>> Yes they are DBF files, but there is no connection to them. They are
    >>>> just simple files. I can zip using the RUN dialog box with the below
    >>>> command, but when I stick the command in the code, all I get is the
    >>>> temp files and an empty zip file.
    >>>> thanks!

    >
    >
    shank, Jan 10, 2006
    #10
    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. Lucas Cowald
    Replies:
    4
    Views:
    1,028
    Tohid
    Oct 23, 2003
  2. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    219
    Genich
    Oct 22, 2003
  3. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page.

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    186
    Oliver
    Oct 22, 2003
  4. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page.

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    168
    Lucas Cowald
    Oct 22, 2003
  5. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page.

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Security
    Replies:
    0
    Views:
    222
    Lucas Cowald
    Oct 22, 2003
Loading...

Share This Page