Vbscript To Run A Batch File
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
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
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
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'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 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 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
I have an asp page written entirely in jscript with a vbscript used as an include file which one variable on the page must access.
When the page runs, I run into jscript complilation errors when it tries to access the include file (since it is written in vbscript), and I can't figure out how to get the two to work together. How do you get both scripting languages to work on the same page?
View Replies
View Related
i would like to add a user and set file permission to a file with ASP.
(No component). is that possible ? do you have a link ? an example ?
View Replies
View Related
Is there a function in VBScript that will return the name of the file
that is currently being executed? Basically, I'm looking for a function
that I can use in code similar to this...
<% response.write "The name of this file is - " thisFile.fileName %>
which will result in
The name of this file is - home.asp
being displayed on the page with home.asp executes.
View Replies
View Related
I'm writing an intranet-only browser based application. I need to launch either a SETUP.EXE that is on a network drive or a shortcut on a local drive that points to the exe on the network drive
I already know how to launch a local exe, for example:
Set objApp = CreateObject("WScript.Shell")
objApp.Run "cmd /C CD C: & Program Files & SomeFolder & SETUP"
View Replies
View Related
What options/methos/properties/functions/objects do I have in order to
create a Function in ASP/VBScript that process/create binary data as an image
file type?
The Function is supoosed to get 2 parameters:
1. The file image content type defined as "image/bmp" , strContentType
2. the file binary data, binDataImageBytes (which is stored in session
vars)
The Function should return/create an Image File , for instance
~tmpImg.BMP
My Question is
How to create a binary Image file type from the session var binary
data ?
View Replies
View Related
I know this is a little off topic, but this is the best resource I know of for anything coding related.
I'm needing to read through a text file that will have the following format:
c:ools
c:docs
c:htdocs
And have the the results put in an array for later processing. What I'm trying to build is a small vbscript that will automatically backup each path that may be in a given txt file.
View Replies
View Related
I want to include a file in a web page according to some details that are retrieved from a database. I have typed the following code:
<% filename = Session("LModCode") & Session("ClassID") & ".inc" %>
<!--#include file="<%=filename%>" -->
This doesn't work. There is nothing wrong with Session variables that I know of, both values are present when i write them to the page. Is it not possible to use vbscript within an include statement?
View Replies
View Related
I am trying to dynamically generate links on a webpage base on a list of file using their title property as the link text. My problem is I don't know how to get the title property of the file. Is there a object or dll i can use?
View Replies
View Related
Is there a way to check if a file exist using VBScript in an ASP page.
So the code might go something like this:
If Exists("C:Junk1.txt") then
Do something
Else
Do something else
End If
View Replies
View Related
i had a vbscript that will read the text file from the bottom to the top, and after reading the file, it will be displayed in the screen, and the code look like this:
PHP Code: Code:
View Replies
View Related
I have a page that creates a .CSV file that has been migrated over to
Windows Server 2003 from Windows 2000 Server. It worked fine before I
moved it, but now when it creates the .CSV file, and you open it, the
first row opens in cell A1 and the second row opens in cell A2. 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