?
Solved

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

Posted on 2006-06-16
5
Medium Priority
?
431 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 800 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 1200 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 1200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
Determining the an SCCM package name from the Package ID
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Suggested Courses

765 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