Jump to content

Trying to add a reg key based on an entered variable


Recommended Posts

My script so far looks like this...

$exename = InputBox("Auto Large Pages","Enter the EXE you want to give Large Pages",".exe")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\"&$exename"", "UseLargePages", "REG_DWORD", "00000001")
Msgbox(0, "Results", "Large Pages Enabled for "&$exename)

The second line is said to be incorrect. I don't understand what I am doing wrong, is it simply impossible to use a variable like that?

Link to comment
Share on other sites

EDIT: after making the changes the script completes now. But I don't see the key added in the registry. I did close regedit and reopen it just in case. Not there.

NVM, it worked. Had to compile and run as administrator. Thanks for your help!

Edited by Cyberdyne
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...