Sign in to follow this  
Followers 0
Cyberdyne

Trying to add a reg key based on an entered variable

6 posts in this topic

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?

Share this post


Link to post
Share on other sites



Try to remove the two "" after your variable.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Add #RequireAdmin at the top of your script to make it run as admin everytime

Share this post


Link to post
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
Sign in to follow this  
Followers 0