Jump to content

iniwrite, not working for me.


Recommended Posts

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!!

Link to comment
Share on other sites

Depends on the operating system you use.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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.

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

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.

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

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

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

×
×
  • Create New...