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.QuerySt ring("jobNbr")
'Log in as an admin. I created a component to impersonate an administrator.
‘This works fine
Set objLogon = Server.CreateOb ject("LoginAdmi n.ImpersonateUs er")
objLogon.Logon "AdminUser" , "AdminPassword" , "domain"
Set wShell = Server.CreateOb ject("WSCRIPT.S HELL")
svrPath = Server.MapPath( "/")
FilesPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ " & jobNbr
ZipPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ ZippedFiles\" & jobNbr &
".zip"
strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath
returncode = wShell.run(strZ ip,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 9180
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**********@d iscussions.micr osoft.com> wrote in message
news:7E******** *************** ***********@mic rosoft.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.QuerySt ring("jobNbr")
'Log in as an admin. I created a component to impersonate an administrator. 'This works fine Set objLogon = Server.CreateOb ject("LoginAdmi n.ImpersonateUs er") objLogon.Logon "AdminUser" , "AdminPassword" , "domain"
Set wShell = Server.CreateOb ject("WSCRIPT.S HELL") svrPath = Server.MapPath( "/") FilesPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ " & jobNbr ZipPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ ZippedFiles\" & jobNbr & ".zip" strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath
returncode = wShell.run(strZ ip,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**********@d iscussions.micr osoft.com> wrote in message news:7E******** *************** ***********@mic rosoft.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.QuerySt ring("jobNbr")
'Log in as an admin. I created a component to impersonate an administrator. 'This works fine Set objLogon = Server.CreateOb ject("LoginAdmi n.ImpersonateUs er") objLogon.Logon "AdminUser" , "AdminPassword" , "domain"
Set wShell = Server.CreateOb ject("WSCRIPT.S HELL") svrPath = Server.MapPath( "/") FilesPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ " & jobNbr ZipPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ ZippedFiles\" & jobNbr & ".zip" strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath
returncode = wShell.run(strZ ip,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**********@d iscussions.micr osoft.com> wrote in message
news:59******** *************** ***********@mic rosoft.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**********@d iscussions.micr osoft.com> wrote in message news:7E******** *************** ***********@mic rosoft.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.QuerySt ring("jobNbr") > > 'Log in as an admin. I created a component to impersonate an > administrator. > 'This works fine > Set objLogon = Server.CreateOb ject("LoginAdmi n.ImpersonateUs er") > objLogon.Logon "AdminUser" , "AdminPassword" , "domain" > > > Set wShell = Server.CreateOb ject("WSCRIPT.S HELL") > svrPath = Server.MapPath( "/") > FilesPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ " & jobNbr > ZipPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ ZippedFiles\" & > jobNbr & > ".zip" > strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath > > returncode = wShell.run(strZ ip,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\ap plications\dev\ AFLDirect\Zip\Q csFiles\ZippedF iles\12345667.z ip
E:\openshare\ap plications\dev\ AFLDirect\Zip\Q csFiles\1234566 7
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**********@d iscussions.micr osoft.com> wrote in message news:59******** *************** ***********@mic rosoft.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**********@d iscussions.micr osoft.com> wrote in message news:7E******** *************** ***********@mic rosoft.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.QuerySt ring("jobNbr") > > 'Log in as an admin. I created a component to impersonate an > administrator. > 'This works fine > Set objLogon = Server.CreateOb ject("LoginAdmi n.ImpersonateUs er") > objLogon.Logon "AdminUser" , "AdminPassword" , "domain" > > > Set wShell = Server.CreateOb ject("WSCRIPT.S HELL") > svrPath = Server.MapPath( "/") > FilesPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ " & jobNbr > ZipPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ ZippedFiles\" & > jobNbr & > ".zip" > strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath > > returncode = wShell.run(strZ ip,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**********@d iscussions.micr osoft.com> wrote in message
news:7E******** *************** ***********@mic rosoft.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.QuerySt ring("jobNbr")
'Log in as an admin. I created a component to impersonate an
administrator. 'This works fine Set objLogon = Server.CreateOb ject("LoginAdmi n.ImpersonateUs er") objLogon.Logon "AdminUser" , "AdminPassword" , "domain"
Set wShell = Server.CreateOb ject("WSCRIPT.S HELL") svrPath = Server.MapPath( "/") FilesPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ " & jobNbr ZipPath = svrPath & "\devl\AFLDirec t\Zip\QcsFiles\ ZippedFiles\" & jobNbr & ".zip" strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath
returncode = wShell.run(strZ ip,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 I'm not sure what changed.
(I had applied ALL the W2K update patches... but... I'm not sure if the
problem started before or after that.)
Did any recent W2K patches change the way createObject, wScript.shell, or
"NET SEND" works?
|
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 website from an existing
web host to our servers. This website used the WScript.Shell command
to execute a series of Java commands that would send an encrypted
email.
I ran these commands directly on the server and they execute properly,
|
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", 0, True
objShell.Run "%comspec% /c PRINT /d:\\Garchive\ISLaser c:\WUTemp\test.txt",
0, True
Set objShell = nothing
|
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 like this:
function runCommand(zmienna)
{
if (zmienna==-1)
{
|
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 setobjShell=Server.CreateObject("WScript.Shell"), I get the error
VB err= 5,Invalid procedure call or argument
| |
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 hard drive.
When I get to this line I get runtime error 429 "ActiveX component
can't create object". I know I should not use WSH but I haven't been
able to figure out an alternative. I tried looking through the VBA
editor help file for "file"...
|
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 folder.However if I am runing the
file local it will work
Any reason, why when the file is in the web server folder
the create object failed to created the shell object.
Systax:
|
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 " & url)
strPResult = objCmd.StdOut.Readall()
set objCmd = nothing: Set objWShell = nothing
|
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, is there a way to "hide" the command prompt which pops up in this case? The python script takes 0.5-1 second to execute, and I'm doing a lot of checks with this, meaning I get alot of windows open. Can I use the objShell.Run command without losing...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |