📨 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
JesseJames_2 Posts: 328 Forumite
Part of the Furniture 100 Posts Name Dropper Combo Breaker
edited 26 June 2009 at 4:46PM in Techie Stuff
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?

Comments

  • gaming_guy
    gaming_guy Posts: 6,128 Forumite
    1,000 Posts Combo Breaker
    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?
  • John_Gray
    John_Gray Posts: 5,844 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    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!
  • JesseJames_2
    JesseJames_2 Posts: 328 Forumite
    Part of the Furniture 100 Posts Name Dropper Combo Breaker
    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.
  • John_Gray
    John_Gray Posts: 5,844 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    edited 26 June 2009 at 3:55PM
    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 ...
  • JesseJames_2
    JesseJames_2 Posts: 328 Forumite
    Part of the Furniture 100 Posts Name Dropper Combo Breaker
    edited 26 June 2009 at 4:06PM
    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.
  • John_Gray
    John_Gray Posts: 5,844 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    It's a good problem! I'm asking elsewhere...
  • JesseJames_2
    JesseJames_2 Posts: 328 Forumite
    Part of the Furniture 100 Posts Name Dropper Combo Breaker
    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 . . .
  • JesseJames_2
    JesseJames_2 Posts: 328 Forumite
    Part of the Furniture 100 Posts Name Dropper Combo Breaker
    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.
  • John_Gray
    John_Gray Posts: 5,844 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    You're correct - network drives are not available in the logon script, unless you map them!
  • JesseJames_2
    JesseJames_2 Posts: 328 Forumite
    Part of the Furniture 100 Posts Name Dropper Combo Breaker
    John_Gray wrote: »
    You're correct - network drives are not available in the logon script, unless you map them!

    Actually, just another hdd/partition on the local PC
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

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

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.