| Windows 7: Logon script not running on Win 7 |
17 Jan 2012
|
#1 | | Microsoft Windows 7 Professional 32-bit 7601 Multiprocessor Free Service Pack 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 System Specs |
| System Manufacturer/Model Number HP Elitebook 6930p OS Microsoft Windows 7 Professional 32-bit 7601 Multiprocessor Free Service Pack 1 CPU Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz Motherboard Hewlett-Packard 30DC Memory 6.00 GB (Yeah, I know... 32-bit. I'm upgrading soon.) Graphics Card ATI Mobility Radeon HD 3450 Sound Card SoundMAX Integrated Digital HD Audio Monitor(s) Displays See "Other Info" Screen Resolution See "Other Info" Keyboard No, I keep my keys in my pocket. Mouse Yes, and getting smarter... traps are empty.... PSU HP supplied 90W Case HP branded EliteBook Silverback Cooling Single fan... looking for mate. Hard Drives Hitachi 160Gb Internet Speed Moody (20MB, business) Other Info I have 2 workstations, both using docking stations:
WS1: SyncMaster E2420 24" wide (1920x1080) & Acer S201HL 20" wide (1600x900)
WS2: Acer AL1916W 19" wide (1280x720 <-- Point of contention) & Laptop display 14" wide (1280x800) |
17 Jan 2012
|
#2 | | Windows 7 Pro X64 Space Coast of Florida |
| My System Specs | | System Manufacturer/Model Number Dell Precision 370 OS Windows 7 Pro X64 CPU Intel Pentium 4 Dual LP 3.4Ghz Memory 4GB DDR PC2-5200 ECC Graphics Card NVIDIA Quadro FX 3400/4400 Sound Card SoundMAX Integrated Digital Audio Monitor(s) Displays HP 22" w2207 LCD Screen Resolution 1680 x 1050 Hard Drives 300GB Maxtor 6L300RD PATA
128GB Kingston SV200S3128G SSD (boot)
1.5TB Seagate ST3150041AS SATA Internet Speed Cable via Road Runner 2MB Upload, 20MB Download |
18 Jan 2012
|
#3 | | Microsoft Windows 7 Professional 32-bit 7601 Multiprocessor Free Service Pack 1 |
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 System Specs | | System Manufacturer/Model Number HP Elitebook 6930p OS Microsoft Windows 7 Professional 32-bit 7601 Multiprocessor Free Service Pack 1 CPU Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz Motherboard Hewlett-Packard 30DC Memory 6.00 GB (Yeah, I know... 32-bit. I'm upgrading soon.) Graphics Card ATI Mobility Radeon HD 3450 Sound Card SoundMAX Integrated Digital HD Audio Monitor(s) Displays See "Other Info" Screen Resolution See "Other Info" Keyboard No, I keep my keys in my pocket. Mouse Yes, and getting smarter... traps are empty.... PSU HP supplied 90W Case HP branded EliteBook Silverback Cooling Single fan... looking for mate. Hard Drives Hitachi 160Gb Internet Speed Moody (20MB, business) Other Info I have 2 workstations, both using docking stations:
WS1: SyncMaster E2420 24" wide (1920x1080) & Acer S201HL 20" wide (1600x900)
WS2: Acer AL1916W 19" wide (1280x720 <-- Point of contention) & Laptop display 14" wide (1280x800) |
18 Jan 2012
|
#4 | | Windows 7 Pro X64 Space Coast of Florida |
Sorry, missed the Domain part.
At the end of the article I linked you to is this: Quote: 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 System Specs | | System Manufacturer/Model Number Dell Precision 370 OS Windows 7 Pro X64 CPU Intel Pentium 4 Dual LP 3.4Ghz Memory 4GB DDR PC2-5200 ECC Graphics Card NVIDIA Quadro FX 3400/4400 Sound Card SoundMAX Integrated Digital Audio Monitor(s) Displays HP 22" w2207 LCD Screen Resolution 1680 x 1050 Hard Drives 300GB Maxtor 6L300RD PATA
128GB Kingston SV200S3128G SSD (boot)
1.5TB Seagate ST3150041AS SATA Internet Speed Cable via Road Runner 2MB Upload, 20MB Download |
19 Jan 2012
|
#5 | | Microsoft Windows 7 Professional 32-bit 7601 Multiprocessor Free Service Pack 1 |
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 02:14 PM..
Reason: Update
| My System Specs | | System Manufacturer/Model Number HP Elitebook 6930p OS Microsoft Windows 7 Professional 32-bit 7601 Multiprocessor Free Service Pack 1 CPU Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz Motherboard Hewlett-Packard 30DC Memory 6.00 GB (Yeah, I know... 32-bit. I'm upgrading soon.) Graphics Card ATI Mobility Radeon HD 3450 Sound Card SoundMAX Integrated Digital HD Audio Monitor(s) Displays See "Other Info" Screen Resolution See "Other Info" Keyboard No, I keep my keys in my pocket. Mouse Yes, and getting smarter... traps are empty.... PSU HP supplied 90W Case HP branded EliteBook Silverback Cooling Single fan... looking for mate. Hard Drives Hitachi 160Gb Internet Speed Moody (20MB, business) Other Info I have 2 workstations, both using docking stations:
WS1: SyncMaster E2420 24" wide (1920x1080) & Acer S201HL 20" wide (1600x900)
WS2: Acer AL1916W 19" wide (1280x720 <-- Point of contention) & Laptop display 14" wide (1280x800) |
19 Jan 2012
|
#6 | | Windows 7 Pro X64 Space Coast of Florida |
You're welcome.
Yesterday's history, tomorrow's a mystery, computers will confuse you forever | My System Specs | | System Manufacturer/Model Number Dell Precision 370 OS Windows 7 Pro X64 CPU Intel Pentium 4 Dual LP 3.4Ghz Memory 4GB DDR PC2-5200 ECC Graphics Card NVIDIA Quadro FX 3400/4400 Sound Card SoundMAX Integrated Digital Audio Monitor(s) Displays HP 22" w2207 LCD Screen Resolution 1680 x 1050 Hard Drives 300GB Maxtor 6L300RD PATA
128GB Kingston SV200S3128G SSD (boot)
1.5TB Seagate ST3150041AS SATA Internet Speed Cable via Road Runner 2MB Upload, 20MB Download Logon script not running on Win 7 problems? All times are GMT -5. The time now is 10:57 PM. | |