We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Trying to run a .reg file on logon script - SOLVED
Options

JesseJames_2
Posts: 328 Forumite


I'm trying to silently run a .reg file within a logon script, but will not work fully.
The same script runs fine by clicking the file.
Basically what I am doing is saving some registry entries to a .reg file and copying some files at logoff.
Then I want to restore them at logon.
I can save the .reg file and the other files within a logoff script.
Within the small logon script is...
regedit /s some.reg
copy "somefiles\" "backup_somefiles\"
It appears to totally bypass the regedit command, but the copy command works.
If the /s switch (suppresses any user interaction) is removed it, then it will then work but the yes/no message box appears, which I don't want. It's to be run transparently.
Any ideas?
The same script runs fine by clicking the file.
Basically what I am doing is saving some registry entries to a .reg file and copying some files at logoff.
Then I want to restore them at logon.
I can save the .reg file and the other files within a logoff script.
Within the small logon script is...
regedit /s some.reg
copy "somefiles\" "backup_somefiles\"
It appears to totally bypass the regedit command, but the copy command works.
If the /s switch (suppresses any user interaction) is removed it, then it will then work but the yes/no message box appears, which I don't want. It's to be run transparently.
Any ideas?
0
Comments
-
JesseJames wrote: »regedit /s some.reg
Most scripts tend to have the switches at the end of the command, like this regedit some.reg /s
also, does the account have the correct permissions to modify the registry?0 -
Interesting problem, because I can't see why your command doesn't work! My guess would be something to do with permissions, too.
Perhaps try REG (as in REG ADD or REG DELETE)? All you have to do is to understand the syntax!0 -
Yes, already tried that, worth a shot, but the syntax is correct, it does run when clicking on it.
But it does not run when logon activates the script.
syntax as per Microsoft
regedit.exe /s path of .reg file.0 -
Yes, your syntax is correct! Have you tried RUNAS an administrator account?
A further thought: perhaps specify the full path of REGEDIT as in
C:\Windows\regedit.exe /s ...0 -
Retried the REG Import command,
The same problem as regedit in that it works by clicking the file, but not within the logon script.
It would appear to be a permissions problem but I am using the administrator account
I am using the Group Policy Editor to run the scripts at logon/off - gpedit.msc
What I am actually doing/ trying to do is copy MailWasherPro settings from one OS to another in a multiboot PC so any changes that are made in one are reflected in the other OS.
OS is XP 64 bit
C:\Windows\regedit.exe /s ...
Tried the full path and same result.
I'll need to dig some more to see what the problem is.0 -
It's a good problem! I'm asking elsewhere...0
-
I've got the output of the script running at logon.
There is no error, but it does not save the reg settings.
E:\WINDOWS\System32\GroupPolicy\User\Scripts\Logon>E:WINDOWS\regedit.exe /s MailwashBKUP2.reg
E:\WINDOWS\System32\GroupPolicy\User\Scripts\Logon>copy "Z:\_DATA\_Repository\MailWasherPro\" "Z:\_DATA\_Repository\MailWasherPro2\"
Z:\_DATA\_Repository\MailWasherPro\Blacklist.txt
Z:\_DATA\_Repository\MailWasherPro\blackList.txt.backup
Z:\_DATA\_Repository\MailWasherPro\filters.txt
Z:\_DATA\_Repository\MailWasherPro\filters.txt.backup
Z:\_DATA\_Repository\MailWasherPro\MailWasherPro.in
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090611
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090612
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090613
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090614
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090615
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090616
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090617
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090618
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090619
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090620
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090621
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090623
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090624
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090625
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090626
Z:\_DATA\_Repository\MailWasherPro\mwSummary.Log
Z:\_DATA\_Repository\MailWasherPro\seenEmail.txt
Z:\_DATA\_Repository\MailWasherPro\spamLog.txt
Z:\_DATA\_Repository\MailWasherPro\Trash.rot135
24 file(s) copied.
E:\WINDOWS\System32\GroupPolicy\User\Scripts\Logon>pause
Press any key to continue . . .0 -
JesseJames wrote: »I've got the output of the script running at logon.
There is no error, but it does not save the reg settings.
E:\WINDOWS\System32\GroupPolicy\User\Scripts\Logon>E:WINDOWS\regedit.exe /s Z:\_DATA\_Repository\MailwashBKUP2.reg
E:\WINDOWS\System32\GroupPolicy\User\Scripts\Logon>copy "Z:\_DATA\_Repository\MailWasherPro\" "Z:\_DATA\_Repository\MailWasherPro2\"
Z:\_DATA\_Repository\MailWasherPro\Blacklist.txt
Z:\_DATA\_Repository\MailWasherPro\blackList.txt.backup
Z:\_DATA\_Repository\MailWasherPro\filters.txt
Z:\_DATA\_Repository\MailWasherPro\filters.txt.backup
Z:\_DATA\_Repository\MailWasherPro\MailWasherPro.in
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090611
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090612
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090613
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090614
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090615
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090616
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090617
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090618
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090619
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090620
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090621
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090623
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090624
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090625
Z:\_DATA\_Repository\MailWasherPro\mwLog.20090626
Z:\_DATA\_Repository\MailWasherPro\mwSummary.Log
Z:\_DATA\_Repository\MailWasherPro\seenEmail.txt
Z:\_DATA\_Repository\MailWasherPro\spamLog.txt
Z:\_DATA\_Repository\MailWasherPro\Trash.rot135
24 file(s) copied.
E:\WINDOWS\System32\GroupPolicy\User\Scripts\Logon>pause
Press any key to continue . . .
Looks like you need an absolute path when using the logon scripts.
But not if you are clicking the file to run it.
Thanks for all the suggestions.0 -
You're correct - network drives are not available in the logon script, unless you map them!0
-
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 351.1K Banking & Borrowing
- 253.1K Reduce Debt & Boost Income
- 453.6K Spending & Discounts
- 244.1K Work, Benefits & Business
- 599K Mortgages, Homes & Bills
- 177K Life & Family
- 257.4K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards