Logon script not running on Win 7


  1. Posts : 46
    Microsoft Windows 7 Professional 64-bit 7601 Multiprocessor Free Service Pack 1
       #1

    Logon script not running on Win 7


    Hi all, new here. Have a little experience with Win 7, a lot with Win XP.

    So here's my situation. I'm trying to create a login script for use on my work's PCs. Most all of our boxes are running XP. Putting this login script into the Starup folder works fine, the script runs on startup and creates its log.

    My PC has recently been upgraded with Win 7 Pro 32 bit. When I manually execute the script, all works. But when I leave it in the Startup folder and reboot, it doesn't run. Msconfig has added an entry in the Startup tab for my script and it is enabled.

    Any suggestions or thoughts on what I might be doing wrong? UAC is turned off, by the way, and my account is an Admin account (both locally and Domain).
      My Computer


  2. Posts : 6,285
    Windows 10 Pro X64
       #2
      My Computer


  3. Posts : 46
    Microsoft Windows 7 Professional 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #3

    Hmm, thank you for the link, but not sure how this helps....

    Let me give a bit more background. As I have already stated, I'm a Domain Admin. Now, I'm still learning a lot concerning IT work... I'm at the bottom of the totem pole in my place of work. But I am learning a lot about remote management... something the rest of the guys where I work at don't know a lot about. I've been trying to find ways to make a lot of the common, remedial tasks I have to do become easier and faster to handle. One of the things I've been looking into is WMI. Now, there's a lot I have to do on a day to day basis that using WMI would make easier by far. Unfortunately, not all of our PCs are config'd by default to allow access to WMI... even by Domain Admins.

    I've written 2 scripts at this point to assist me in enabling it on all of the PCs without having to visit each one individually. The first one is the one that actually enables everything. It must be run locally on the PC and I don't want to be disturbing all of our users with asking them to run this file for me or have them break away from their PC for a moment so that I can. So, I'm placing it into the Startup folders. Why not push it out via Group Policy? Well, I haven't been told I can use it yet... and the few others in our IT Dept that could (2 people out of 4 (including myself)... for 7 different sites) are too wrapped up in other projects and individual site needs to help me.

    So this leads me to my second script. It remotely connects in through the PCs via the c$ share of each computer and places the scripts into the Startup folders. That's all I can do. Any PC that doesn't have WMI enabled will not allow any more access than that as far as I'm aware. Thus, it needs to work on the first go, or get written off as needing a personal visit.

    Thankfully, currently we only have something like 4 or 5 PCs in the whole company running Win 7. Everything else is XP with a couple 2ks that run stuff too critical to risk replacing/upgrading at this time. But we've been exploring upgrading to Win 7 Pro (possibly 64 bit) sometime in the near future. I need to understand why the script will run manually just fine with no prompts, but through the Startup folder does not execute. I can tell the Startup folder is working. I placed a third party exe file into the folder and it came up when I logged in. Is there something about the Startup folder that it won't run certain file types? Such as .vbs files?

    So basically, I need to find a way to make this work as is, with no other trickery, as it needs to be assumed that the only thing I can do is copy files from one PC to another in those cases where the WMI features and the like have been turned off.
      My Computer


  4. Posts : 6,285
    Windows 10 Pro X64
       #4

    Sorry, missed the Domain part.

    At the end of the article I linked you to is this:

    runas /user:SomeLocalAdminAccount Here must be like this:
    runas /noprofile /user:mymachine\administrator cmd runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""
    What if you create two scripts (batch files). The first one would use runas to start the 2nd which does whatever you need.
      My Computer


  5. Posts : 46
    Microsoft Windows 7 Professional 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #5

    Hmm... the runas doesn't seem to work too well for my purposes. It prompts for a password.

    cmd /c myscript.vbs seems to work, though. One catch is that the command window pops open for a short time. I'd rather this not happen.

    EDIT: Wow... I really don't know what is going on, but it is working now. I decided to throw another .vbs script into the startup folder to see if I could confirm if it was indeed that .vbs scripts couldn't be run directly from the startup folder, but it ran. So then I tried popping my original .vbs script back in there... completely unaltered as of the last failed attempt at getting it to run from there... and this time it worked. Bizarre. Anyway, all is well now. Thank you very much for your assistance!
    Last edited by FuryoftheStars; 19 Jan 2012 at 14:14. Reason: Update
      My Computer


  6. Posts : 6,285
    Windows 10 Pro X64
       #6

    You're welcome.

    Yesterday's history, tomorrow's a mystery, computers will confuse you forever
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 21:23.
Find Us