|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ASP run command line
What is the proper syntax to run this command line in ASP?
wzzip.exe File.zip File.txt thanks 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 Show quote "shank" <sh***@tampabay.rr.com> wrote in message news:%23HegY1tEGHA.1028@TK2MSFTNGP11.phx.gbl... > What is the proper syntax to run this command line in ASP? > > wzzip.exe File.zip File.txt > > thanks > 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! ----------------------------------------------- Show quote "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:OlBUNXuEGHA.2856@TK2MSFTNGP12.phx.gbl... > 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" <sh***@tampabay.rr.com> wrote in message > news:%23HegY1tEGHA.1028@TK2MSFTNGP11.phx.gbl... >> What is the proper syntax to run this command line in ASP? >> >> wzzip.exe File.zip File.txt >> >> thanks >> > > 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 Show quote "shank" <sh***@tampabay.rr.com> wrote in message news:%23mdlN5vEGHA.564@TK2MSFTNGP10.phx.gbl... > 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:OlBUNXuEGHA.2856@TK2MSFTNGP12.phx.gbl... >> 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" <sh***@tampabay.rr.com> wrote in message >> news:%23HegY1tEGHA.1028@TK2MSFTNGP11.phx.gbl... >>> What is the proper syntax to run this command line in ASP? >>> >>> wzzip.exe File.zip File.txt >>> >>> thanks >>> >> >> > > 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! Show quote "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:ePm4rTwEGHA.1028@TK2MSFTNGP11.phx.gbl... > 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" <sh***@tampabay.rr.com> wrote in message > news:%23mdlN5vEGHA.564@TK2MSFTNGP10.phx.gbl... >> 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:OlBUNXuEGHA.2856@TK2MSFTNGP12.phx.gbl... >>> 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" <sh***@tampabay.rr.com> wrote in message >>> news:%23HegY1tEGHA.1028@TK2MSFTNGP11.phx.gbl... >>>> What is the proper syntax to run this command line in ASP? >>>> >>>> wzzip.exe File.zip File.txt >>>> >>>> thanks >>>> >>> >>> >> >> > > You explained that in your previous post. Did you try testing it with text
files? Ray at work Show quote "shank" <sh***@tampabay.rr.com> wrote in message news:%23UKiRYwEGHA.2012@TK2MSFTNGP14.phx.gbl... > 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:ePm4rTwEGHA.1028@TK2MSFTNGP11.phx.gbl... >> 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" <sh***@tampabay.rr.com> wrote in message >> news:%23mdlN5vEGHA.564@TK2MSFTNGP10.phx.gbl... >>> 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:OlBUNXuEGHA.2856@TK2MSFTNGP12.phx.gbl... >>>> 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" <sh***@tampabay.rr.com> wrote in message >>>> news:%23HegY1tEGHA.1028@TK2MSFTNGP11.phx.gbl... >>>>> What is the proper syntax to run this command line in ASP? >>>>> >>>>> wzzip.exe File.zip File.txt >>>>> >>>>> thanks >>>>> >>>> >>>> >>> >>> >> >> > > 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! Show quote "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:etBOzqwEGHA.1424@TK2MSFTNGP12.phx.gbl... > You explained that in your previous post. Did you try testing it with > text files? > > Ray at work > > "shank" <sh***@tampabay.rr.com> wrote in message > news:%23UKiRYwEGHA.2012@TK2MSFTNGP14.phx.gbl... >> 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:ePm4rTwEGHA.1028@TK2MSFTNGP11.phx.gbl... >>> 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" <sh***@tampabay.rr.com> wrote in message >>> news:%23mdlN5vEGHA.564@TK2MSFTNGP10.phx.gbl... >>>> 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:OlBUNXuEGHA.2856@TK2MSFTNGP12.phx.gbl... >>>>> 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" <sh***@tampabay.rr.com> wrote in message >>>>> news:%23HegY1tEGHA.1028@TK2MSFTNGP11.phx.gbl... >>>>>> What is the proper syntax to run this command line in ASP? >>>>>> >>>>>> wzzip.exe File.zip File.txt >>>>>> >>>>>> thanks >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > 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? Show quote "shank" <sh***@tampabay.rr.com> wrote in message news:u$bGd0wEGHA.2012@TK2MSFTNGP14.phx.gbl... >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:etBOzqwEGHA.1424@TK2MSFTNGP12.phx.gbl... >> You explained that in your previous post. Did you try testing it with >> text files? >> >> Ray at work >> >> "shank" <sh***@tampabay.rr.com> wrote in message >> news:%23UKiRYwEGHA.2012@TK2MSFTNGP14.phx.gbl... >>> 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! 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! Show quote "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:eKuf9QxEGHA.2380@TK2MSFTNGP12.phx.gbl... > 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" <sh***@tampabay.rr.com> wrote in message > news:u$bGd0wEGHA.2012@TK2MSFTNGP14.phx.gbl... >>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:etBOzqwEGHA.1424@TK2MSFTNGP12.phx.gbl... >>> You explained that in your previous post. Did you try testing it with >>> text files? >>> >>> Ray at work >>> >>> "shank" <sh***@tampabay.rr.com> wrote in message >>> news:%23UKiRYwEGHA.2012@TK2MSFTNGP14.phx.gbl... >>>> 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! > > 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! - - - - - - - - - - - Show quote "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:eKuf9QxEGHA.2380@TK2MSFTNGP12.phx.gbl... > 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" <sh***@tampabay.rr.com> wrote in message > news:u$bGd0wEGHA.2012@TK2MSFTNGP14.phx.gbl... >>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:etBOzqwEGHA.1424@TK2MSFTNGP12.phx.gbl... >>> You explained that in your previous post. Did you try testing it with >>> text files? >>> >>> Ray at work >>> >>> "shank" <sh***@tampabay.rr.com> wrote in message >>> news:%23UKiRYwEGHA.2012@TK2MSFTNGP14.phx.gbl... >>>> 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! > > |
|||||||||||||||||||||||