?
Solved

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

Posted on 2006-06-16
5
Medium Priority
?
435 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

Industry Leaders: 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

An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

650 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