Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Okay here's the problem ,
when a user browses to a web page , i can get it so a prompt asks them for their net bios name .. when they click ok the information is displayed back to them using the document.write function .....
however instead of displaying the function on the screen ... is it possible to write the function on the page but inserting it into another script ???
ie
can it be writted to this :
var shell=new ActiveXObject("WScript.shell");
Shell.Run("cmd /k reg update 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\control\session manager\memory management\paging files'='C:\pagefile.sys 256 256' \\<net bios name>', 0);the net bios name being the inputted data from the user ...
casn it be done ... if so how ??
thanks in advance

okay this is a page i've got that will adjust the virtual memory setting of a machine over the corporate network ..
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML>
<HEAD>
<TITLE> Baguley </TITLE></HEAD>
<BODY ><SCRIPT LANGUAGE="JavaScript" type="text/javascript">
</SCRIPT>
<CENTER>
<H1>Drive Mapped Successfully !</H1>
</CENTER>
<CENTER>
<FORM>
<INPUT type="button" value="Close Window" onClick="window.close()">
</FORM>
</CENTER>
</BODY></HTML>
now obviously the net bios name will be different for each machine ... so i'd need to create a form that will change the "netbios name" after user input....
any idea's how i can do this ??
I thought that this might do it .. however i keep getting syntax errors ..:P
<HTML>
<HEAD>
<SCRIPT type="text/javascript" LANGUAGE="JavaScript">
function executeCommands(inputparms)
{
// Instantiate the Shell object and invoke
its execute method.var oShell = new ActiveXObject("WScript.Shell");
var commandtoRun=('cmd /k reg update "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management\\pagingfiles"="C:\\pagefiles.sys 784 784" \', 0);
if (inputparms != "")
{
var commandParms = document.Form1.filename.value;
}// Invoke the execute method.
oShell.ShellExecute(commandtoRun, commandParms,
"", "open", "1");
}
</SCRIPT>
</HEAD>
<BODY>
<FORM name="Form1">
<CENTER>
<H1>Execute PC Commands From HTML </H1>
<File Name to Open:> <Input type="text"
name="filename"/>
<input type="Button" name="Button1"
value="Adjust Virtual Memory on Local Machine" onClick="executeCommands()" />
<input type="Button" name="Button2"
value="Adjust Virtual Memory on a Remote Machine"
onClick="executeCommands(' + hasPARMS + ')" /></CENTER>
</BODY>
</FORM>
help me please .. :P

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |