Executing A Batch File From Asp?
We're trying to write an application that will allow a user to enter an id field from an ASP intranet page and when they hit the enter button, fire off a print job. The problem is, Adobe must be open as the items being printed are PDFs.
We tried firing off a print command using MS SQL cmdShell() (not sure if that is the exact name of the command) and it works, but it never completes. The process hangs in the database because, we think, it hasn't closed Adobe, therefore never coming back to the query. We wrote the query into an ASP page.
Adobe must be open or the documents won't print properly.
Does anyone have any suggestions to how we can automate this?
View Replies
ADVERTISEMENT
Security issues, warning messages, etc., aside,
what MIME-type combination do I need for and ASP to write a BAT file to the response stream?
e.g.
Response.Clear
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment;filename=message.bat"
Response.Write("net send COMPUTER2 success")
Response.End()
This code does not work!
Which is surprising because in my current config, the following html works fine, and executes on the shell:
<A href="message.bat">test</A>
View Replies
View Related
how to call a batch (.bat) file from an asp file
View Replies
View Related
Was wondering if anyone had any suggestions on how to execute a local batch file by simply pressing a button on an ASP page?
View Replies
View Related
how to run a local Batch file from an asp page by simply pressing a button on the page?
View Replies
View Related
I have a batch file that needs to execute every day and I need to run it in a silent/invisible mode. I looked up on the Internet and found this command: shell("batchfilename.bat").
Upon failure, learned that it is a Visual Basic command and not VBScript command. I wonder if anyone knows how to run a batch file using vbscript that runs in invisible mode?
View Replies
View Related
I'm trying to call a batch file that I've built using the FileSystemObject and CreateObject("Wscript.Shell"), oShell.Run. in an asp script. Naturally, I can get the script to work from a command line but not from abrowser. The page does not throw an error but the oShell.Run. portion of the script doesn't run.
View Replies
View Related
I'm trying to run the server.execute command inside a executed file. It doesn't work. Can anybody tell me why? I've searched all around and haven't found a reason. Could it be because it's not supose to work, or is the syntax diferent then in the first file?
It's something like this:
File 1
...
<%Server.Execute("File2.asp")%>
...
File 2
...
<%Server.Execute("file3.asp")%>
...
File 3
<HTML>
<body>
Hello!
</body>
</HTML>
Is this possible?
View Replies
View Related
i used following code:
<%
set wshell = server.createobject("WScript.shell")
wshell.run "E:aaa.bat"
set wshell = nothing
response.write("worked")
%>
It does not show any error message and gives the output "worked"
I have installed .dll files for wsscript
Is there any other way to call batch file from aan asp page .
View Replies
View Related
I've tried instantiating the Windows Script Host shell object in ASP,
and I'm trying to run this command: "cscript.exe myvbs.vbs parameter1
parameter2"; however, the server runs cscript.exe very briefly, and the
task ends. Note, it runs fine from a command prompt. Do I need to give
the anonymous user any special permissions in order to do this?
View Replies
View Related
I used to be able to Execute '.VBS' files from ASP pages. I think the facility stopped in IIS6. Security feature I guess - any work arounds available ?
View Replies
View Related
I have a batch file that takes variables from the cmd and passes them by sqlcmd to an SQL script. When I pass the variable 'MikeTestList' the script runs as expected with no problems. When I passed 'BulkTransferTest' I got an error message, 'The string or binary data will be truncated'.
Some testing has shown that I get the error when the string is anything above 12 characters. Is there a limit to the length of a string you can pass using sqlcmd from a batch file? Is there any way around it?
Also, if I have a space in the string, it only passes the string up to the space. I have tried to fill it with a '%' which then gets passed as is, so the % stays in place through out the script. Code:
View Replies
View Related
Is there a way to determine the filepath of an ASP script being executed, like so? First file contains:
<%
For Each x In arrNuggets
Server.Execute "/nuggets/" & x & "/default.asp"
Next
%>
The executed file, default.asp, needs to be able to figure out what it's parent folder name is.
Request.ServerVariables("SCRIPT_NAME") only returns the name of the first initial page loaded, and nothing about the page currently being executed.
View Replies
View Related
I m writing one code to invoke remote desktop service for given IP address. For that i m using mstsc.exe file to invoke RDP.
I have a no of links to be displayed on the page and on click of link, RDP for that IP should be called. Currently i m using one button to invoke RDP. Code:
View Replies
View Related
We have LOADS of documents scanned to PDF format, stored
in SQL tables.Allowing a client to browse our ASP driven site to select
and view individual PDFs has been no problem. ("index"
table is queried to show list of available PDFs, user
clicks a link in the list, PDF reader shows the document
in a new window.)
Now, they would like a feature that would PRINT (at their
location) batches of documents via the website,
preferablely with a single click.
View Replies
View Related
First, a little background. I'm developing an order management system for my company and I want to be able to print a batch of packing slips in one go without pulling each one up on the screen and clicking 'Print'.
How can I do this in ASP? The only way I can come up with is to loop through the records and concatenate a string with the HTML code and then send that string to the printer. But, I'm not exactly sure that's the best way or if it is even possible.
I want to basically click a button that says "Print All Packing Slips" and never see an output screen.
View Replies
View Related
i have to start a batch process from a dll to transfer
files created by this dll to remote ftp server. I created
a batch file:
ftp -n -v -i -s:D:atchftpcmds.txt ftp-server
and a file containing the ftp commands:
user username password
lcd D:atchmedia
mput *.*
quit
It works pefectly when i start it from the dosbox. But
when i call it from the vb dll implemented in IIS (shell
("D:atch ransfer.bat")), it does not complete the
transfer and hangs after 400-500 (small) files.
View Replies
View Related
How do I statically change my ip address to specific IP via a DOS batch file and back to DHCP via another DOS batch file?
View Replies
View Related
I have a web page that sends emails to groups of recipients. It uses CDONTS to send each email. While it works fine for sending a small amount of emails out, it chokes the page when sending to large amount of email addresses. Basically, it loops through each email address and sets the CDONTS object each time. I need to do this because each email is personalized.
Does anyone have any thoughts around how to optimize this code. Is there anyway in ASP to send the code to a background process for example?
View Replies
View Related
I need to send batch html emails out from a db mailing list (anything up to 1000 in one go).I am using CDOSYS and standard ASP. My problem is that it will error if I try to do any more that 5 every 30 seconds - this is fine when I send them out myself (I have a script to do this) but now I need a program which will allow users to send out batches and I want it to appear seamless.
View Replies
View Related
How do I statically change my ip address to specific IP via a DOS batch file and back to DHCP via another DOS batch file?
View Replies
View Related
How do people go about batch updates. I can do batch deletes no prob.
In ref to bacth updates such as One to Many.
Lets say i want to move everyone from one group to another
thats where i'm stuck.
Tbl1 : Category
Tbl2 : Users
If for instance i need to change 45 (id=25) users from
Tbl1.field3 to Tbl1.field3 to (id=18)
In Tbl2
View Replies
View Related
I would like to send batch e-mail from fields in multiple records.
View Replies
View Related
I have a form that users enter details of a car (e.g make model , idnumber#) and then press save to save to the database they may want to order 10 cars with the same details exept the idnumber so to save the users entering in all 5 details I want to make it easier.
Should I have a list box and let the user add idnumber items from a text box and then pass this to my update asp and loop through + to save to the database or should I
save one record and then return back to the same form Note : I am having problems with this method as only part of the fields show when I hit the back button I just wondered what is the best method of doing this I am spoilt for choice and I also get problems.
View Replies
View Related
if anyone has experience in building the ability to upload/insert multiple images from one directory on the client machine to an Access database via asp. The process would be to click on the browse button for the correct images and you would be able to click on multiple images using ctrl or shift button and then insert the selected files into the database. Can this be done?
View Replies
View Related
how to go about sending a batch of sql statements from asp to sql server, and
having errors appropriately handled? for example,
i want to send the following stored procedure calls to sql server in a
single batch from my asp code, rather than using a loop in asp to execute
each procedure individiually. if one of these fails, they all should fail.
exec myProc @param1 = 'A'
exec myProc @param1 = 'B'
exec myProc @param1 = 'C'
exec myProc @param1 = 'D'
exec myProc @param1 = 'E'
exec myProc @param1 = 'F'
View Replies
View Related
im trying to run a bat file on windows server 2003 and am running into nothing but problems.
i have IIS on my XP workstation that accesses the 2003 server. what im about to explain below works properly on the XP IIs.
i have two files: somefile.asp and somefile.bat. the asp file creates a wscript.shell and then tries to execute the run method for somefile.bat.
however, it isnt working. after an unexaggerated 7 hours of searching google/etc, i have found nothing but frustration and deep, seething anger regarding this problem. Code:
View Replies
View Related
What is the preferred method of executing .bat or .exe via ASPs
View Replies
View Related
Is it possible to make an ASP script that continues to run after the browser window is closed? I have a script that is going to run continuously for multiple days, and don't want to leave the browser window open. Maybe this can be achieved by executing a command for the system to run it?
View Replies
View Related
I am using the below command to restart a service on one of my web
boxes, this runs fine from the command prompt and also through a *.bat
file.
"Server1Applist$BOBJCentralMSpsservice.exe" Server2 -u
eutee-ww02pUsername -p password restart BOBJCentralMS
I found this asp code in this forum but can not get it to work with my
command
<%
Dim oShell, sCommand
sCommand = "MyCommand"
Set oShell = CreateObject("WScript.Shell")
oShell.Run sCommand, , True
Set oShell = Nothing
%>
I replace "MYCommand" with the command i wish to execute but the page
just hangs with the blue status bar halfway complete at the bottom,
when checking the services on the box it is not restarted.
View Replies
View Related
If I execute the following:
Code:
qSQL3="insert into eli_encomenda_linha (eli_enc_codigo, eli_codigo, eli_pro_codigo, eli_pro_designacao, eli_quantidade, eli_preco_unitario, eli_desconto, eli_imposto, eli_emb_codigo, eli_men_codigo) values (" & codigoEncomenda & ", " & lCiclo & ", '" & Session("idProduto" & lCiclo) & "', '" & Session("Descr" & lCiclo) & "', " & Session("qtdProduto" & lCiclo) & ", " & Session("preco" & lCiclo) & ", " & Session("Desconto" & lCiclo) & ", " & imposto & ", " & embCodigo & ", " & menCodigo & ")"
oConn2.Execute(qSQL3)
Everything is OK but, if i put the same in an do while, loop then, the following error appears:
-2147217900 - [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
View Replies
View Related
Is there any sample about getting the results from executing an exe using
asp?
View Replies
View Related
I have a file called Audit.asp that I want to execute via command line from a batch file (bulk.bat)How can I do this?
View Replies
View Related