# scripting

**URL:** <https://forums.suse.com/t/scripting/24777>\
**Category:** Chatting over the Back Fence\
**Created:** [November 19, 2013, 9:11pm UTC](https://forums.suse.com/t/scripting/24777 "2013-11-19T21:11:05Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![System1](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@System1](https://forums.suse.com/u/System1)\
**Post date:** [November 19, 2013, 9:11pm UTC](https://forums.suse.com/t/scripting/24777/1 "2013-11-19T21:11:05Z")

</div>

Anyone here have some good tips to get a .vbs script to run when a  
computer is logged of _or_ shut down?

I’ve been trying all kinds of things and got it to work correctly once,  
most of the time the machine acts like the script doesn’t run at all.

Windows 7 64bit machines.

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 20, 2013, 3:04am UTC](https://forums.suse.com/t/scripting/24777/2 "2013-11-20T03:04:45Z")

</div>

Stevo wrote:  
[color=blue]

> Anyone here have some good tips to get a .vbs script to run when a  
> computer is logged of or shut down?[/color]

Power on the computer then login! 😉

–  
Kevin Boyle - Knowledge Partner  
If you find this post helpful and are logged into the web interface,  
show your appreciation and click on the star below…

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 20, 2013, 3:58pm UTC](https://forums.suse.com/t/scripting/24777/3 "2013-11-20T15:58:47Z")

</div>

For Logged Off - Windows Task Scheduler.

For Logged Off or Powered Off - Use ZCM to Assign a Scheduled Task as  
well as to Schedule WOL Power Up.

On 11/19/2013 2:11 PM, Stevo wrote:[color=blue]

> Anyone here have some good tips to get a .vbs script to run when a  
> computer is logged of _or_ shut down?
> 
> I’ve been trying all kinds of things and got it to work correctly once,  
> most of the time the machine acts like the script doesn’t run at all.
> 
> Windows 7 64bit machines.  
> [/color]

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 20, 2013, 4:45pm UTC](https://forums.suse.com/t/scripting/24777/4 "2013-11-20T16:45:17Z")

</div>

Craig Wilson sounds like they ‘said’:  
[color=blue]

> For Logged Off or Powered Off - Use ZCM to Assign a Scheduled Task as  
> well as to Schedule WOL Power Up.[/color]

So my response to Craig’s comment is…

Unfortunately we don’t run ZCM…

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 20, 2013, 4:58pm UTC](https://forums.suse.com/t/scripting/24777/5 "2013-11-20T16:58:08Z")

</div>

Then you can build your own WOL task scheduler.  
A bit more work…

On 11/20/2013 9:45 AM, Stevo wrote:[color=blue]

> Craig Wilson sounds like they ‘said’:  
> [color=green]
> 
> > For Logged Off or Powered Off - Use ZCM to Assign a Scheduled Task as  
> > well as to Schedule WOL Power Up.[/color]
> 
> So my response to Craig’s comment is…
> 
> Unfortunately we don’t run ZCM…  
> [/color]

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 20, 2013, 4:59pm UTC](https://forums.suse.com/t/scripting/24777/6 "2013-11-20T16:59:49Z")

</div>

Ton of free WOL tools, you just need to collect and associate MACs to  
PCs you want to wakeup.

So on a Central Computer, Use the Windows Scheduler to run WOL tasks at  
2am or whatever.

Then Have Windows Task Scheduler configured to run defined actions at  
2:30am for good measure.

On 11/20/2013 9:58 AM, Craig Wilson wrote:[color=blue]

> Then you can build your own WOL task scheduler.  
> A bit more work…
> 
> On 11/20/2013 9:45 AM, Stevo wrote:[color=green]
> 
> > Craig Wilson sounds like they ‘said’:  
> > [color=darkred]
> > 
> > > For Logged Off or Powered Off - Use ZCM to Assign a Scheduled Task as  
> > > well as to Schedule WOL Power Up.[/color]
> > 
> > So my response to Craig’s comment is…
> > 
> > Unfortunately we don’t run ZCM…  
> > [/color]  
> > [/color]

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 20, 2013, 5:11pm UTC](https://forums.suse.com/t/scripting/24777/7 "2013-11-20T17:11:09Z")

</div>

Stevo,  
[color=blue]

> Craig Wilson sounds like they ‘said’:  
> [color=green]
> 
> > For Logged Off or Powered Off - Use ZCM to Assign a Scheduled Task as  
> > well as to Schedule WOL Power Up.[/color]
> 
> So my response to Craig’s comment is…
> 
> Unfortunately we don’t run ZCM…  
> [/color]

It’s a good thing you don’t, or Craig’s response would be considered  
product support and you’d both get thwacked. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 20, 2013, 7:16pm UTC](https://forums.suse.com/t/scripting/24777/8 "2013-11-20T19:16:48Z")

</div>

Craig Wilson sounds like they ‘said’:  
[color=blue]

> Ton of free WOL tools, you just need to collect and associate MACs to  
> PCs you want to wakeup.
> 
> So on a Central Computer, Use the Windows Scheduler to run WOL tasks  
> at 2am or whatever.
> 
> Then Have Windows Task Scheduler configured to run defined actions at  
> 2:30am for good measure.  
> [/color]  
> So my response to Craig’s comment is…

We are basically trying to get a script to run (in our VDI envir) that  
exports the default printer reg setting to a .reg file, then have a  
login script that imports that setting back in.

What we’ve tried so far we’ve gotten to work once, then the logoff  
script never seems to work again.

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 20, 2013, 7:18pm UTC](https://forums.suse.com/t/scripting/24777/9 "2013-11-20T19:18:31Z")

</div>

Black, Douglas sounds like they ‘said’:  
[color=blue]

> It’s a good thing you don’t, or Craig’s response would be considered  
> product support and you’d both get thwacked. :)[/color]

So my response to Black’s comment is…

Yeah, wouldn’t want that…

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 21, 2013, 9:46pm UTC](https://forums.suse.com/t/scripting/24777/10 "2013-11-21T21:46:01Z")

</div>

You might have tried this already but we run a login VB script under  
Group Policy: User Configuration; Windows Settings, Scripts  
(Logon/Logoff), in Windows 7 and works every time.

## – lanaleon

lanaleon’s Profile: [https://forums.novell.com/member.php?userid=16538](https://forums.novell.com/member.php?userid=16538)  
View this thread: [https://forums.novell.com/showthread.php?t=472851](https://forums.novell.com/showthread.php?t=472851)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 21, 2013, 10:45pm UTC](https://forums.suse.com/t/scripting/24777/11 "2013-11-21T22:45:20Z")

</div>

lanaleon sounds like they ‘said’:  
[color=blue]

> You might have tried this already but we run a login VB script under  
> Group Policy: User Configuration; Windows Settings, Scripts  
> (Logon/Logoff), in Windows 7 and works every time.[/color]

So my response to lanaleon’s comment is…

The login script is not the problem, it’s getting one to run during  
logoff or shutdown.

Moving now to try just running a scheduled task during the day,  
thinking that might work out for us.

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 21, 2013, 11:29pm UTC](https://forums.suse.com/t/scripting/24777/12 "2013-11-21T23:29:06Z")

</div>

Gotta be careful…

I heard stories that even the Sicilian Mafia steers clear of the Novell  
Chat Enforcers…

On 11/20/2013 10:11 AM, Black, Douglas wrote:[color=blue]

> Stevo,  
> [color=green]
> 
> > Craig Wilson sounds like they ‘said’:  
> > [color=darkred]
> > 
> > > For Logged Off or Powered Off - Use ZCM to Assign a Scheduled Task as  
> > > well as to Schedule WOL Power Up.[/color]
> > 
> > So my response to Craig’s comment is…
> > 
> > Unfortunately we don’t run ZCM…  
> > [/color]
> 
> It’s a good thing you don’t, or Craig’s response would be considered  
> product support and you’d both get thwacked. 🙂
> 
> [/color]

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 22, 2013, 7:49pm UTC](https://forums.suse.com/t/scripting/24777/13 "2013-11-22T19:49:46Z")

</div>

Ok, so figured out a scheduled task to do what I want, made the mistake  
of being in the User portion of the GPO to get this to work when I need  
to be in the Computer portion.

Set up the exact same script in the Computer portion of GPO, @#$%ing  
scheduled task will not run.

Anyone have any suggestions? Aside from Zen, fdisk, etc, etc.

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [December 5, 2013, 11:17am UTC](https://forums.suse.com/t/scripting/24777/14 "2013-12-05T11:17:23Z")

</div>

“Stevo” [steveSPAM@LESSccgov.net](mailto:steveSPAM@LESSccgov.net) wrote in news:\_OMju.269$FD5.257  
@novprvlin0913.provo.novell.com:  
[color=blue]

> Set up the exact same script in the Computer portion of GPO, @#$%ing  
> scheduled task will not run.
> 
> Anyone have any suggestions? Aside from Zen, fdisk, etc, etc.[/color]

Never ever use mapped drive letters. Use a UNC path in all scheduled task  
script actions on MS Windows.  
I just battled some tasks and “relearned” this, this week.  
Might help 🙂

* * *

This email is free from viruses and malware because avast! Antivirus protection is active.  
[http://www.avast.com](http://www.avast.com)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [December 5, 2013, 4:47pm UTC](https://forums.suse.com/t/scripting/24777/15 "2013-12-05T16:47:00Z")

</div>

Dave Taylor sounds like they ‘said’:  
[color=blue]

> Never ever use mapped drive letters. Use a UNC path in all scheduled  
> task script actions on MS Windows.  
> I just battled some tasks and “relearned” this, this week.  
> Might help :)[/color]

So my response to Dave’s comment is…

Thinking this was a permissions issue. Ended up putting needed files  
local to the VM templates, setting a scheduled task on the template,  
the linked clones then run it fine.

Little bit of a PITA, but we only needed this for our virtual desktops  
anyway, so it worked out ok…so far.

–  
Stevo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [December 8, 2013, 6:02am UTC](https://forums.suse.com/t/scripting/24777/16 "2013-12-08T06:02:40Z")

</div>

“Stevo” [steveSPAM@LESSccgov.net](mailto:steveSPAM@LESSccgov.net) wrote in news:El0ou.1070$FD5.22  
@novprvlin0913.provo.novell.com:  
[color=blue]

> Little bit of a PITA, but we only needed this for our virtual desktops  
> anyway, so it worked out ok…so far. [/color]

Good news 🙂

* * *

This email is free from viruses and malware because avast! Antivirus protection is active.  
[http://www.avast.com](http://www.avast.com)
