I am trying to run a command line from an ASP page. I am using windows 2003
with IIS6. I am able to get this to run on my local machine (Windows XP
IIS5). Here is my code:
jobNbr = Request.QueryString("jobNbr")
'Log in as an admin. I created a component to impersonate an administrator.
‘This works fine
Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser")
objLogon.Logon "AdminUser", "AdminPassword", "domain"
Set wShell = Server.CreateObject("WSCRIPT.SHELL")
svrPath = Server.MapPath("/")
FilesPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\" & jobNbr
ZipPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\ZippedFiles\" & jobNbr &
".zip"
strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath
returncode = wShell.run(strZip,0,true)
response.write returncode
Set wShell = nothing
objLogon.LogOff
set objLogon = nothing
When I run this th ReturnCode’s value is 254. I can’t find any info about
this code. I am assuming it has something to do with permissions or how IIS
is setup. I have tried creating a new application pool for this, but I still
get the same result. I checked the Web Service extensions and that seems to
look OK, but I could be wrong.
Thanks 5 9153
try writing the command to the page
response.write strZip
then copy and run it manually see if you can spot a error
"Daniel Di Vita" <Da**********@discussions.microsoft.com> wrote in message
news:7E**********************************@microsof t.com... I am trying to run a command line from an ASP page. I am using windows 2003 with IIS6. I am able to get this to run on my local machine (Windows XP IIS5). Here is my code:
jobNbr = Request.QueryString("jobNbr")
'Log in as an admin. I created a component to impersonate an administrator. 'This works fine Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser") objLogon.Logon "AdminUser", "AdminPassword", "domain"
Set wShell = Server.CreateObject("WSCRIPT.SHELL") svrPath = Server.MapPath("/") FilesPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\" & jobNbr ZipPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\ZippedFiles\" & jobNbr & ".zip" strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath
returncode = wShell.run(strZip,0,true) response.write returncode
Set wShell = nothing objLogon.LogOff set objLogon = nothing
When I run this th ReturnCode's value is 254. I can't find any info about this code. I am assuming it has something to do with permissions or how IIS is setup. I have tried creating a new application pool for this, but I still get the same result. I checked the Web Service extensions and that seems to look OK, but I could be wrong.
Thanks
I have and it does work on a command line.
"Slim" wrote: try writing the command to the page
response.write strZip
then copy and run it manually see if you can spot a error
"Daniel Di Vita" <Da**********@discussions.microsoft.com> wrote in message news:7E**********************************@microsof t.com...I am trying to run a command line from an ASP page. I am using windows 2003 with IIS6. I am able to get this to run on my local machine (Windows XP IIS5). Here is my code:
jobNbr = Request.QueryString("jobNbr")
'Log in as an admin. I created a component to impersonate an administrator. 'This works fine Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser") objLogon.Logon "AdminUser", "AdminPassword", "domain"
Set wShell = Server.CreateObject("WSCRIPT.SHELL") svrPath = Server.MapPath("/") FilesPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\" & jobNbr ZipPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\ZippedFiles\" & jobNbr & ".zip" strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath
returncode = wShell.run(strZip,0,true) response.write returncode
Set wShell = nothing objLogon.LogOff set objLogon = nothing
When I run this th ReturnCode's value is 254. I can't find any info about this code. I am assuming it has something to do with permissions or how IIS is setup. I have tried creating a new application pool for this, but I still get the same result. I checked the Web Service extensions and that seems to look OK, but I could be wrong.
Thanks
does the string contain any " ' or other troublesome characters?
"Daniel Di Vita" <Da**********@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com... I have and it does work on a command line.
"Slim" wrote:
try writing the command to the page
response.write strZip
then copy and run it manually see if you can spot a error
"Daniel Di Vita" <Da**********@discussions.microsoft.com> wrote in message news:7E**********************************@microsof t.com... >I am trying to run a command line from an ASP page. I am using windows >2003 > with IIS6. I am able to get this to run on my local machine (Windows XP > IIS5). Here is my code: > > jobNbr = Request.QueryString("jobNbr") > > 'Log in as an admin. I created a component to impersonate an > administrator. > 'This works fine > Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser") > objLogon.Logon "AdminUser", "AdminPassword", "domain" > > > Set wShell = Server.CreateObject("WSCRIPT.SHELL") > svrPath = Server.MapPath("/") > FilesPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\" & jobNbr > ZipPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\ZippedFiles\" & > jobNbr & > ".zip" > strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath > > returncode = wShell.run(strZip,0,true) > response.write returncode > > Set wShell = nothing > objLogon.LogOff > set objLogon = nothing > > When I run this th ReturnCode's value is 254. I can't find any info > about > this code. I am assuming it has something to do with permissions or how > IIS > is setup. I have tried creating a new application pool for this, but I > still > get the same result. I checked the Web Service extensions and that > seems > to > look OK, but I could be wrong. > > Thanks >
I know you are trying to help, but you need to read my post. I stated I was
able to get this to work on my local XP machine. On my 2003 server is where I
am having the problem. Here is a response.write of the string:
wzzip.exe -rp -ee -ybc
E:\openshare\applications\dev\AFLDirect\Zip\QcsFil es\ZippedFiles\12345667.zip
E:\openshare\applications\dev\AFLDirect\Zip\QcsFil es\12345667
I have tried using hte full path of the wzzip.exe, but that still doesn't
work.
"Slim" wrote: does the string contain any " ' or other troublesome characters?
"Daniel Di Vita" <Da**********@discussions.microsoft.com> wrote in message news:59**********************************@microsof t.com...I have and it does work on a command line.
"Slim" wrote:
try writing the command to the page
response.write strZip
then copy and run it manually see if you can spot a error
"Daniel Di Vita" <Da**********@discussions.microsoft.com> wrote in message news:7E**********************************@microsof t.com... >I am trying to run a command line from an ASP page. I am using windows >2003 > with IIS6. I am able to get this to run on my local machine (Windows XP > IIS5). Here is my code: > > jobNbr = Request.QueryString("jobNbr") > > 'Log in as an admin. I created a component to impersonate an > administrator. > 'This works fine > Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser") > objLogon.Logon "AdminUser", "AdminPassword", "domain" > > > Set wShell = Server.CreateObject("WSCRIPT.SHELL") > svrPath = Server.MapPath("/") > FilesPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\" & jobNbr > ZipPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\ZippedFiles\" & > jobNbr & > ".zip" > strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath > > returncode = wShell.run(strZip,0,true) > response.write returncode > > Set wShell = nothing > objLogon.LogOff > set objLogon = nothing > > When I run this th ReturnCode's value is 254. I can't find any info > about > this code. I am assuming it has something to do with permissions or how > IIS > is setup. I have tried creating a new application pool for this, but I > still > get the same result. I checked the Web Service extensions and that > seems > to > look OK, but I could be wrong. > > Thanks >
"Daniel Di Vita" <Da**********@discussions.microsoft.com> wrote in message
news:7E**********************************@microsof t.com... I am trying to run a command line from an ASP page. I am using windows
2003 with IIS6. I am able to get this to run on my local machine (Windows XP IIS5). Here is my code:
jobNbr = Request.QueryString("jobNbr")
'Log in as an admin. I created a component to impersonate an
administrator. 'This works fine Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser") objLogon.Logon "AdminUser", "AdminPassword", "domain"
Set wShell = Server.CreateObject("WSCRIPT.SHELL") svrPath = Server.MapPath("/") FilesPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\" & jobNbr ZipPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\ZippedFiles\" & jobNbr & ".zip" strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath
returncode = wShell.run(strZip,0,true) response.write returncode
Set wShell = nothing objLogon.LogOff set objLogon = nothing
When I run this th ReturnCode's value is 254. I can't find any info about this code. I am assuming it has something to do with permissions or how
IIS is setup. I have tried creating a new application pool for this, but I
still get the same result. I checked the Web Service extensions and that seems
to look OK, but I could be wrong.
Thanks http://www.codeproject.com/atl/sawzip.asp
I use this component to manipulate/create zip files with in ASP. Although I
do place my own VB wrapper round it to make things even easier and make sure
the interface is script friendly. Having said you should be able to use it
directly from ASP.
Should enable you avoid needing the administrator password being present in
a ASP file and having to launch a separate process to do the zipping.
Anthony. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bill |
last post by:
I used to be able to run the following ASP code on our corp machine (W2K
Server Edition and IIS-5)
and successfully send a net-msg to anyone on our intranet.
Last week it stopped working... and...
|
by: Kyle |
last post by:
To any who chose to provide an answer, or even any suggestions to this
problem, I thank you greatly in advance. +200 pts. for any valid
solutions.
I am currently in the process of converting a...
|
by: Salty Dog |
last post by:
No error or any feedback that I can work with.
Code:
set objShell = Server.CreateObject("WScript.Shell")
objShell.Run "%comspec% /c NET PRINT \\Garchive\ISLaser
>c:\WUTemp\Printer_Status1.txt",...
|
by: Marcin Zmyslowski |
last post by:
Hello all!
I have installed MSDE on my local computer - Windows 2000 Professional.
I have created a function which runs me a link whose path is placed in
the input field. This function looks...
|
by: MacKenzie |
last post by:
The statement in an asp page:
dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
now gives this error:
VB err= 424,Object required
If I use...
|
by: rcmail14872 |
last post by:
I have seen some very general suggestions for alternative code to the
WScript.Shell code, but nothing specific. In the two lines of code
below (I think) the first line creates a text file on the...
|
by: Mike John |
last post by:
I am trying to use the shell object to send keys to the
explorer browser to run the send page funcion.
I am receiving the above error only when I put my html
file in the web server...
|
by: =?Utf-8?B?VG9kZA==?= |
last post by:
Hello I'm using the following script to try and ping:
<% Response.Buffer = true %>
<%
url = "www.espn.com"
Set objWShell = CreateObject("WScript.Shell")
Set objCmd = objWShell.Exec("ping " &...
|
by: ellipsism |
last post by:
Hello,
I'm using VBA from Excel to call a python script with some arguments. The python script returns only true or false, which is the information I want to take back into Excel.
I'm wondering,...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |