bRvO
asked on
Windows XP Reg Add function .
Okay , here's my problem.
I run this command on a web page on windows NT machines and it works fine ... it doesnt work when you run it on XP machines tho :/
var cmdln = 'cmd /k reg update "HKEY_LOCAL_MACHINE\\'+
'SYSTEM\\CurrentControlSet \\Control\ \'+
'Session Manager\\Memory Management\\'+
'pagingfiles"="C:\\pagefil e.sys 256 256" '+''+assetnumber+'';
var shell=new ActiveXObject("WScript.she ll");
shell.run(cmdln);
.. managed to figure out that there was no reg update function in XP ( wooh go me :/ ) , so changed the script slightly... to this :
var cmdln = 'cmd /k reg add "\\\\'+assetnumber'+\\HKLM \\SYSTEM\\ '+
'CurrentControlSet\\Contro l\\'+
'Session Manager\\Memory Management\\'+
'/v PagingFiles /t REG_MULTI_SZ /d C:\pagefile.sys\0256\0256 /f"';
var shell=new ActiveXObject("WScript.she ll");
shell.run(cmdln);
but recieve the error : invalid Key name
ignore the '+assetnumber+' please as this is part of another script in the page ... I have however removed it from the page to try the command and still recieve the error ..
this command works in a command prompt window : reg add "HKLM\SYSTEM\CurrentContro lSet\Contr ol\Session Manager\Memory Management" /v PagingFiles /t REG_MULTI_SZ /d C:\pagefile.sys\0256\0256 /f
anyone any idea's as to how i'm entering the incorrect syntax for this. ?? thanks in advance much appreciated.
I run this command on a web page on windows NT machines and it works fine ... it doesnt work when you run it on XP machines tho :/
var cmdln = 'cmd /k reg update "HKEY_LOCAL_MACHINE\\'+
'SYSTEM\\CurrentControlSet
'Session Manager\\Memory Management\\'+
'pagingfiles"="C:\\pagefil
var shell=new ActiveXObject("WScript.she
shell.run(cmdln);
.. managed to figure out that there was no reg update function in XP ( wooh go me :/ ) , so changed the script slightly... to this :
var cmdln = 'cmd /k reg add "\\\\'+assetnumber'+\\HKLM
'CurrentControlSet\\Contro
'Session Manager\\Memory Management\\'+
'/v PagingFiles /t REG_MULTI_SZ /d C:\pagefile.sys\0256\0256 /f"';
var shell=new ActiveXObject("WScript.she
shell.run(cmdln);
but recieve the error : invalid Key name
ignore the '+assetnumber+' please as this is part of another script in the page ... I have however removed it from the page to try the command and still recieve the error ..
this command works in a command prompt window : reg add "HKLM\SYSTEM\CurrentContro
anyone any idea's as to how i'm entering the incorrect syntax for this. ?? thanks in advance much appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yeah , that would cause a problem with adding the asset number .. if managed to get it to work without the assetnumber part ...
this is what i used
car cmdln = 'cmd /k reg add "HKLM\\SYSTEM\CurrentContr olSet\\Con trol\Sessi on Manager\\Memory Management" /v PagingFiles /t REG_MULTI_SZ /d "C:\pagefile.sys 1024 1024" /f';
that changes the Virtual Memory on any XP machine that runs the web page...
just got to add the assetnumber part now :o
thanks for your help ... :)
this is what i used
car cmdln = 'cmd /k reg add "HKLM\\SYSTEM\CurrentContr
that changes the Virtual Memory on any XP machine that runs the web page...
just got to add the assetnumber part now :o
thanks for your help ... :)
ASKER
done it . pretty simple really :/
var cmdln = 'cmd /k reg add "\\\\'+assetnumber+'\\HKLM \\SYSTEM\\ CurrentCon trolSet\\C ontrol\\Se ssion Manager\\Memory Management" /v PagingFiles /t REG_MULTI_SZ /d "C:\\pagefile.sys 1024 1024" /f';
(all one line )
when the prompt appears as the page loads ... just enter the netbios/ip address of the remote machine and click ok ... comman completed succesfully appears . checked the remote machine and it works.
for anyone who's interested .. the local machine needs to have ActiveX enabled ( all settings )
and this needs to be in the page header
<html>
<head>
var assetnumber= prompt('please enter asset number',' ');
if ( (assetnumber==' ') || (assetnumber==null) )
{
assetnumber="ERROR";
}
</head>
var cmdln = 'cmd /k reg add "\\\\'+assetnumber+'\\HKLM
(all one line )
when the prompt appears as the page loads ... just enter the netbios/ip address of the remote machine and click ok ... comman completed succesfully appears . checked the remote machine and it works.
for anyone who's interested .. the local machine needs to have ActiveX enabled ( all settings )
and this needs to be in the page header
<html>
<head>
var assetnumber= prompt('please enter asset number',' ');
if ( (assetnumber==' ') || (assetnumber==null) )
{
assetnumber="ERROR";
}
</head>
ASKER
cheers for your help .... your comments provided me with that little bit extra that I needed to get the result .
thanks :D
thanks :D
Wow - thank YOU. : )
Happy to assist in any way I can. Glad you got it working.
Happy to assist in any way I can. Glad you got it working.
ASKER
cheers anyway :x