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



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æ">postmaster@dit-domæ</a>"
jMail.Subject = "test af jmail"
jMail.ServerAddress = "mail.dit-domæ"
jMail.AddRecipient "<a href=""></a>"
jMail.Body = " Tillykke mailen er sendt."
jMail.Priority = 3

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æ
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.

Set Jmail = Server.CreateObject("JMail.SMTPMail")
JMail.ServerAddress = "mail.dit-domæ"
JMail.Charset = "iso-8859-1"
JMail.ContentTransferEncoding = "8bit"
JMail.Sender = "<a href="mailto:postmaster@dit-domæ">postmaster@dit-domæ</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=""></a>"

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.


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";

<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>