Jump to content

Recommended Posts

Posted

Hi guys,

I'm trying to add a startup script using autoit.

One of the steps is writing to the "C:\Windows\System32\GroupPolicy\Machine\Scripts\scripts.ini" file.

Problem is even though I run the code it doesn't change the actual file, and it returns "1" meaning it was successful.

$ini = "C:\Windows\System32\GroupPolicy\Machine\Scripts\scripts.ini"
$val1 = IniWrite($ini, "Shutdown","0CmdLine", "C:\Scripts\USBReminder.exe")
$val2 = IniWrite($ini, "Shutdown","0Parameters", "")
MsgBox(0, "", $val1 & @CRLF & $val2)

Thanks!!

Posted

Depends on the operating system you use.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

If you're on a limited user account (either xp/vista/7), you shouldn't be able to write to any file under C:Windows.

  Reveal hidden contents

 

Posted

Just to make sure we aren't overlooking the obvious, scrutinize the path you've set in $ini to make sure it is correct. If that isn't the case, attempt to manually write to that file yourself and see what happens.

  Reveal hidden contents

 

Posted

If I open the file in notepad I can write to it. If I try creating a file using command prompt it shows that it exists, but it isn't in the folder. Same if I try to echo>> into a file in that folder, also doesn't show, but it doesn't throw an error either.

This is strange

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
×
×
  • Create New...