Logon script not running on Win 7

FuryoftheStars

New member
Member
Local time
12:39 PM
Messages
46
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

Computer type
Laptop
Computer Manufacturer/Model Number
HP ZBook 17 G2
OS
Microsoft Windows 7 Professional 64-bit 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz
Motherboard
Hewlett-Packard 2255
Memory
16.00 GB
Graphics Card(s)
NVIDIA Quadro K3100M
Sound Card
Realtek High Definition Audio; NVIDIA High Definition Audio
Monitor(s) Displays
Samsung 24" + Acer 20"
Hard Drives
SanDisk SD6PP4M-256G-1006 ATA Device
HGST HTS721010A9E6300 SCSI Disk Device 1TB internal
HGST HTS721010A9E6300 SCSI Disk Device 1TB external (docking station)

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
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

Computer type
Laptop
Computer Manufacturer/Model Number
HP ZBook 17 G2
OS
Microsoft Windows 7 Professional 64-bit 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz
Motherboard
Hewlett-Packard 2255
Memory
16.00 GB
Graphics Card(s)
NVIDIA Quadro K3100M
Sound Card
Realtek High Definition Audio; NVIDIA High Definition Audio
Monitor(s) Displays
Samsung 24" + Acer 20"
Hard Drives
SanDisk SD6PP4M-256G-1006 ATA Device
HGST HTS721010A9E6300 SCSI Disk Device 1TB internal
HGST HTS721010A9E6300 SCSI Disk Device 1TB external (docking station)
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:[email protected] "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

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
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:

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
HP ZBook 17 G2
OS
Microsoft Windows 7 Professional 64-bit 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz
Motherboard
Hewlett-Packard 2255
Memory
16.00 GB
Graphics Card(s)
NVIDIA Quadro K3100M
Sound Card
Realtek High Definition Audio; NVIDIA High Definition Audio
Monitor(s) Displays
Samsung 24" + Acer 20"
Hard Drives
SanDisk SD6PP4M-256G-1006 ATA Device
HGST HTS721010A9E6300 SCSI Disk Device 1TB internal
HGST HTS721010A9E6300 SCSI Disk Device 1TB external (docking station)
You're welcome.

Yesterday's history, tomorrow's a mystery, computers will confuse you forever :D
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
Back
Top