Link to home
Start Free TrialLog in
Avatar of w_marquardt
w_marquardtFlag for United States of America

asked on

Turn off offline files via registry setting

In windows xp pro, is there a registry setting that can be used to simply turn off offline files?

Thanks,

Bill
Avatar of sirbounty
sirbounty
Flag of United States of America image

Try this...

Start->Run->cmd /k reg add hklm\software\microsoft\windows\currentversion\netcache /v enabled /t reg_dword /d 0

That will disable them...
Avatar of w_marquardt

ASKER

Almost there. It works.. Yea! but I need to be able to run it from a batch file so that I can include it in a series of other updates that I'm doing at the same time. It also needs to run silent as well. The prompt whether to add the value messes up the process.

For my own education, I've been using a tool to modify the registry in a Windows Batch type mode (Macro Scheduler). When I open a command line window and run the code you provided, it works. When I put it into a batch file, it doesn't. Looking at the code, it looks like it's writing a '0' into the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\NetCache,Enabled Dword.

While I can write directly into the registry with Macro Scheduler, when I write a '0' into it does change it correctly, but offline files are still enabled. Can you tell me what else is going on in the code so I can learn what I'm missing?

Thanks,

Bill
ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hmm... Still not working (now not at all).

When I put the code into the batch file and add a pause command just to see what it did, it does show that 'the operation completed successfully.' If I check the registry setting, the dword has changed to '0' but the check mark is still in the Enable offline files box (tools / folder options / offline files (tab)). If I log off and log back on, it's still on.

Any idea on why this isn't working as expected (or what I'm doing wrong with the code?)

Thanks,

Bill
I have a good idea...you are running this with limited user permissions?

HKLM must be modified using an Admin account...
Nope, I'm both local and domain admin on the machine.
Perhaps it's in HKCU as well?

http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/92773.mspx?mfr=true details this setting further.  Could it be that it's also set in group policy?
I've always seen it work at the local machine level and not per user. I'll check on the machine when I'm in next (tomorrow). It might just be a hinkey machine. I'm going to add the change to the registry in my script and hope for the best. Worst case, I turn it off by hand (annoying but some projects are only worth so much time). At least it's only a 100 computers and not a 1000 <g>.

I'll assign the points after I check on the HKCU and update the answer here for future reference.

Thanks,

Bill
One more think. Do you think the value '0' should be an integer or a string? Maybe that's my problem?

Thanks,

Bill
No, it's definitely a dword value on that one...
Sirbounty,

Sorry about the long delay on this. This was one of many clients I work with and I got pulled off the project. I just got back to it and it works fine on every computer except my test computer. Go figure...

Thanks for all the help.

Regards,

Bill
Avatar of roseki
roseki

You could actually create a policy that would accomplish the same thing, but allow you to turn it on and off for specific groups.  We turn it on for Laptop users and off for Workstation users; based on machine groups.