§Ú­Ì¥i¥H±N±¥Îªº¨ç¦¡¡A©ñ¦b¤@­Ó¨ç¦¡©w¸qÀÉ¤º¡AµM«á¦A±q¨ä¥Lµ{¦¡¤¤¡A¥[¤J¦¹ÀÉ®×¡A´N¥i¥H¨Ï¥Î¦¹¨ç¦¡©w¸qÀÉ¤¤©Ò©w¸qªº¨ç¦¡¡CWSH ©Ò¥Îªº¨ç¦¡ÀÉ®×¡A¥i¥H¨ã¦³¥ô¦ó°ÆÀÉ¦W¡A¦ý§Ú­Ì³q±±N¦¹Ãþ¨ç¦¡ÀÉ®×ªº°ÆÀÉ¦W³]©w¬° fun¡]³o¬O§Ú­Ó¤Hªº²ßºD¡A§A¤]¥i¥H¿ï¥Î¤£¦Pªº°ÆÀÉ¦W¡^¡A¥H¸ê°Ï§O¡C

¨Ò¦p¡A§Ú­Ì¥i¥H±N­pºâ¥Ñ1¨ìnªºÁ©Mªº¨ç¦¡¡A©ñ¦b sumFunction.fun¡A¦p¤U¡G

// ¦¹¨ç¼Æ­pºâ¥Ñ 1 ¥[¨ì n ªºÁ©M
function sum(n) {
var i, total=0;
for (i=1; i<=n; i++)
total = total + i;
return(total);
}

­Y­n©I¥s¦¹ÀÉ®×©Ò©w¸qªº¨ç¦¡¡A³q±§Ú­Ì¥²¶·±N¥Dµ{¦¡ªº°ÆÀÉ¦W§ï¬° wsf¡A¨Ã¨Ï¥Î¤U­z¤è¦¡¨Ó¾É¤J¨ç¦¡©w¸qÀÉ¡G

<script src="sumFunction.fun"></script> ¨Ò¦p¡G

<job>
<script src="sumFunction.fun"></script>
<script>
// ©I¥s¨ç¼Æ¥H­pºâ¥Ñ 1 ¥[¨ì n ªºÁ©M
n = 40;
WScript.Echo("1+2+...+" + n + " = " + sum(n));
</script>
</job>


<job>
<script src="sumFunction.fun"></script>

<script language=jscript>
n = 40;
WScript.Echo("1+2+...+" + n + " = " + sum(n) + " (via Jscript)");
</script>

<script language=vbscript>
n = 40
WScript.Echo("1+2+...+" & n & " = " & sum(n) & " (via Vbscript)")
</script>

</job>

<script language=jscript runat=server src="file.fun">