Dos batch – part of file name

Written by Leif Stenfeldt. Posted in Dos, Programmering, Tips

Calls one batch program from another.

CALL [drive:][path]filename [batch-parameters]

If Command Extensions are enabled, CALL changes as follows:

CALL command now accepts labels as the target of the CALL. The syntax is:

CALL :label arguments
A new batch file context is created with the specified arguments and control is passed to the statement after the label specified. You must “exit” twice by reaching the end of the batch script file twice. The first time you read the end, control will return to just after the CALL statement. The second time will exit the batch script. Type GOTO /? for a description of the GOTO :EOF extension that will allow you to “return” from a batch script.

In addition, expansion of batch script argument references (%0, %1, etc.) have been changed as follows:

%* in a batch script refers to all the arguments (e.g. %1 %2 %3 %4 %5 …)

 

Substitution of batch parameters (%n) has been enhanced. You can now use the below optional syntax:

%~1 expands %1 removing any surrounding quotes (“)
%~f1 expands %1 to a fully qualified path name
%~d1 expands %1 to a drive letter only

1717 views

JMAIL

Written by Leif Stenfeldt. Posted in Programmering

JMail komponenten gør det muligt, at sende en E-mail direkte fra en ASP side. se nedenstående eksempel.
Du kan finde andre eksempler hos activedeveloper.


<%
set jmail = server.createobject("JMAIL.SMTPMail")
jMail.sendername = "Servermarket"
jMail.sender = "<a href="mailto:postmaster@dit-domænenavn.dk">postmaster@dit-domænenavn.dk</a>"
jMail.Subject = "test af jmail"
jMail.ServerAddress = "mail.dit-domænenavn.dk"
jMail.AddRecipient "<a href="mailto:modtagerens@emailadresse.dk">modtagerens@emailadresse.dk</a>"
jMail.Body = " Tillykke mailen er sendt."
jMail.Priority = 3
jMail.execute
%>

Værd at vide
1. afsender adresse skal eksistere på serveren som en popkonto ikke som et alias.
2. mailserver du skal bruge er den samme som outlook opsætning f.eks mail.dit-domæne.dk
3. start altid med at sende til postmaster som test. Har du slettet postmaster
så brug den konto som du logger ind på, for at tjekke mail.
JMAIL HTML Formular

<%
Set Jmail = Server.CreateObject("JMail.SMTPMail")
JMail.ServerAddress = "mail.dit-domænenavn.dk"
JMail.Charset = "iso-8859-1"
JMail.ContentTransferEncoding = "8bit"
JMail.Sender = "<a href="mailto:postmaster@dit-domænenavn.dk">postmaster@dit-domænenavn.dk</a>"
JMail.Subject = "test af jmail"
JMail.Sendername = "Servermarket"
JMail.HTMLBody = "&lt;hr&gt;&lt;br&gt;Hej der...&lt;br&gt; Gik testen Godt&lt;br&gt;"

JMail.Priority = 3
JMail.AddRecipient "<a href="mailto:modtagerens@emailadresse.dk">modtagerens@emailadresse.dk</a>"
JMail.Execute
%>
1331 views

IIS – Enable parent paths

Written by Leif Stenfeldt. Posted in Errors, Programmering

Server-Side Include Directives (#include) Return 404 Error (for .stm Files) or 0131 Error (for .asp Files)

If your ASP page uses the #include server-side include directive and the “..” notation to refer to a parent directory, the directive will return an error unless you have reconfigured the AspEnableParentPaths metabase property. This property is set to false by default. If set to true, this property constitutes a potential security risk because an include path may access critical or sensitive data files outside the application root directory.

2216 views

PHP / Checkbox

Written by Leif Stenfeldt. Posted in Programmering

<?
$msg = "";
if (isset($_REQUEST['submit'])) {
while(list($key, $value) = each($_POST['checkbox'])) $msg.=$value."\n";
print $msg." > - data";
<!--more-->}
?>

</p>
<form name="form1" method="post" action="m.php">
<input type="checkbox" name="checkbox[]" value="1">1<br>
<input type="checkbox" name="checkbox[]" value="2">2<br>
<input type="checkbox" name="checkbox[]" value="3">3<br>
<input type="submit" name="submit" id="submit" value="Submit"><br>
</form>
1396 views