Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: .wsf autmatic run placement?  (Read 2838 times)

0 Members and 1 Guest are viewing this topic.

Chrisxs5

    Topic Starter


    Hopeful
  • Sup!?
  • Thanked: 8
    • Where we learn IT daily!
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 8
.wsf autmatic run placement?
« on: October 15, 2007, 12:27:36 PM »
I (when I say "I", I mean very good software) have wrote a script that when double clicked works perfectly. Now I would like to know where the script should be placed in order for the computer to run it automatically. I tried putting it in the Startup folder, but that did not work. Another fact about the script is it is set to work based on a maped drive, so would there be a boot order isse? I.E. the script would try to run before the drive is mapped?
Check out my blog: http://vitrookie.com

System, Network, Virtualization, Storage, ETC Admin with a bunch of certs and an ego trip!

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: .wsf autmatic run placement?
« Reply #1 on: October 16, 2007, 07:57:27 AM »
You might try using the sleep method in your script to delay execution until the drive is mapped otherwise we need know more about your environment.

Are the drives mapped by another script? Is there is a master script executing child scripts to actually carry out specific tasks? If so, you could use the shell object's run method to wait for each script to finish before starting the next script.

You might also mention if your using Active Directory.

 8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

Chrisxs5

    Topic Starter


    Hopeful
  • Sup!?
  • Thanked: 8
    • Where we learn IT daily!
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 8
Re: .wsf autmatic run placement?
« Reply #2 on: October 16, 2007, 09:30:36 AM »
System One:
I am using active directory with all mapped drives running from a login.bat script.

System Two:
Uses AD as well, but the maps are local reconnects at stratup. Eventually this system will be converting to system one, but the computer I tested from was on this system.
Check out my blog: http://vitrookie.com

System, Network, Virtualization, Storage, ETC Admin with a bunch of certs and an ego trip!

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: .wsf autmatic run placement?
« Reply #3 on: October 16, 2007, 05:29:38 PM »
For System One I suggest creating a reference in the login.bat file for the wsf job:

Code: [Select]
call CScript //Job:MyFirstJob MyScripts.wsf

Replace MyFirstJob with the job name you gave the job step in the wsf file. Replace MyScripts with the name of your wsf file (note: you may need to append drive and path info to the reference). Place the reference after the drives have been mapped.

For System Two, I suggest placing a shortcut to the wsf file in the startup folder. Use the WScript.Sleep interval method at the top of the wsf file logic to delay the wsf file execution until the drives are mapped. The interval is measured in milliseconds (ie: 1 sec = 1000 ms). You may have to play around with the interval until you get it right.

If you have any problems let us know. Good luck.  8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein