Solved

NEWBIE: How to update a Scheduled Task with new path?

Posted on 2006-06-16
5
420 Views
Last Modified: 2013-12-28
Dear Experts,

We've been using InstallShield to install our product at customer sites.  Previously, we'd insisted on a hard-coded location.  Now we'll be letting them pick.

We ship a Scheduled Task with the product, which contains both:

Run:  (a btach job, with full path)

and

Start In: (the working directory, with same full path)

Before, we could hard-code that full path.  Now we need to change it either during or immediately after the install.

Is there a fairly simple way to do this?  (We're pretty much dummies about installations...)  Could InstallShield (pro) handle it?  Could we write a Java program to do it?  I looked at the Scheduled Task itself, with WordPad, and it's not in plain text.  

Thanks a lot!
--BrianMc1958
0
Comment
Question by:BrianMc1958
  • 2
  • 2
5 Comments
 

Author Comment

by:BrianMc1958
ID: 16923360
BTW: That was "batch job", not "btach job" or "botched job".
0
 

Assisted Solution

by:saporis
saporis earned 200 total points
ID: 16928067
Please explain further.

Are we going to be using the windows task schedualer?

Or, in a PROGRAMMING sense?  I have never used any "3rd" party installer, but I'm sure there's a way to detect the string in the "destination box".

Or, in worse case, you can hardcode the program to either use: ".\filehere" so it can run in the current directory without any problems, or, perform "cd \", or, as I have done in the past to sneak out of a linux chroot dungeon, "cd ..", cd .., cd.. cd ..
0
 
LVL 30

Assisted Solution

by:callrs
callrs earned 300 total points
ID: 16930696
You just need to change shortcut properties? It's simple with VBScript. Write a script to:
- Bring up a Browse for Folder dialog
- User selects the Run & Start-in paths
- Paths are returned into two variables
- Now that you you have the values in the variables, you can change the shortcut properties, using code such as this from http://www.codecomments.com/archive299-2004-5-199041.html):
' Create a shortcut object on the desktop
Set WS1 = WSHShell.CreateShortcut("C:\Documents and Settings\All_ Users\Desktop\" & fname & ".lnk")
' Set shortcut object properties and save it
WS1.TargetPath =WSHShell.ExpandEnvironmentStrings("%PCOMM_Root%_ \private\" & fname)
WS1.WorkingDirectory =WSHShell.ExpandEnvironmentStrings("%PCOMM_Root%_ \private")
WS1.WindowStyle = 4
WS1.IconLocation =WSHShell.ExpandEnvironmentStrings("%PCOMM_Root%_ \pcsws.exe, 1")
WS1.Save

0
 

Author Comment

by:BrianMc1958
ID: 16934141
Sorry.  I should have been more clear.

Ideally, what will happen is that the user will choose a particular directory on which to install our product, via InstallShield.  Then (with no futher user intervention) we would somehow plug that directory path into a pre-existing Scheduled Task (which already ships with our product.)  

I'm trying to avoid having the user go to Scheduled Tasks themselves during installation.  
0
 
LVL 30

Accepted Solution

by:
callrs earned 300 total points
ID: 16934832
If the task launches a custom program of your's, why not add this feature to that program:
- extract the install path from the user's registry. The path (in Win 98, XP, etc) is stored in the user's registry upon install.
- use that path to from a working directory path & update the shortcut on the users computer.

Or maybe better, make a separate program that will do the above steps just once on first-run.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

For a variety of reasons, it sometimes makes sense to reboot a Windows-based computer on a regular, perhaps daily basis. This "cures" a lot of ills by resetting processes, flushing caches, refreshing memory, and reestablish network connections. In a…
Several part series to implement Internet Explorer 11 Enterprise Mode
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now