JUst a Programming Question about creating a shortcut

G

Guest

First off I apologise because this is not a true access question, BUT I know
with all the experts here someone can help, if not oh well


I am trying to run a vbs script to place a shortcut on the desktop. the
problem is that the script blows up.

Here is the line that blows up

MyShortcut.TargetPath = ""C:\Program Files\Symantec\pcAnywhere\awhost32.exe"
"C:\Documents and Settings\All Users\Application
Data\Symantec\pcAnywhere\Remotes\Cable.CHF" /C /D"

The problem is that the script does not like multiple "" if I manually
enter the shortcut on the desktop it will read like this and work

"C:\Program Files\Symantec\pcAnywhere\awhost32.exe" "C:\Documents and
Settings\All Users\Application Data\Symantec\pcAnywhere\Hosts\Network, Cable,
DSL.BHF" /C /D

for the vbs script to at least work I have to modify the line in the script
to look like this

C:\Program Files\Symantec\pcAnywhere\awhost32.exe C:\Documents and
Settings\All Users\Application Data\Symantec\pcAnywhere\Hosts\Network, Cable,
DSL.BHF /C /D

that places an icon on the desktop but the line reads like this


"C:\Program Files\Symantec\pcAnywhere\awhost32.exe C:\Documents and
Settings\All Users\Application Data\Symantec\pcAnywhere\hosts\Nigel.CHF \C \D"

it has reversed the / to a \ and doesnt work


I understand if I don't get an answer but at hopefully someone can at least
point me to somewhere where I can resolve this

Thanks
 
J

Jesper

I am trying to run a vbs script to place a shortcut on the desktop. the
problem is that the script blows up.

Here is the line that blows up

MyShortcut.TargetPath = ""C:\Program
Files\Symantec\pcAnywhere\awhost32.exe"
"C:\Documents and Settings\All Users\Application
Data\Symantec\pcAnywhere\Remotes\Cable.CHF" /C /D"

Would substituting your inner " with chr(34) where you have "" work?
Just a suggestion.

Jesper Fjølner, Denmark
 
D

Dave Patrick

Try;

oShellLink.TargetPath = """C:\Program
Files\Symantec\pcAnywhere\awhost32.exe""" & " " & """C:\Documents and
Settings\All Users\Application Data\Symantec\pcAnywhere\Hosts\Network,
Cable, DSL.BHF"""
oShellLink.Arguments = "/C /D"

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| First off I apologise because this is not a true access question, BUT I
know
| with all the experts here someone can help, if not oh well
|
|
| I am trying to run a vbs script to place a shortcut on the desktop. the
| problem is that the script blows up.
|
| Here is the line that blows up
|
| MyShortcut.TargetPath = ""C:\Program
Files\Symantec\pcAnywhere\awhost32.exe"
| "C:\Documents and Settings\All Users\Application
| Data\Symantec\pcAnywhere\Remotes\Cable.CHF" /C /D"
|
| The problem is that the script does not like multiple "" if I manually
| enter the shortcut on the desktop it will read like this and work
|
| "C:\Program Files\Symantec\pcAnywhere\awhost32.exe" "C:\Documents and
| Settings\All Users\Application Data\Symantec\pcAnywhere\Hosts\Network,
Cable,
| DSL.BHF" /C /D
|
| for the vbs script to at least work I have to modify the line in the
script
| to look like this
|
| C:\Program Files\Symantec\pcAnywhere\awhost32.exe C:\Documents and
| Settings\All Users\Application Data\Symantec\pcAnywhere\Hosts\Network,
Cable,
| DSL.BHF /C /D
|
| that places an icon on the desktop but the line reads like this
|
|
| "C:\Program Files\Symantec\pcAnywhere\awhost32.exe C:\Documents and
| Settings\All Users\Application Data\Symantec\pcAnywhere\hosts\Nigel.CHF \C
\D"
|
| it has reversed the / to a \ and doesnt work
|
|
| I understand if I don't get an answer but at hopefully someone can at
least
| point me to somewhere where I can resolve this
|
| Thanks
|
|
 
G

Guest

Hi, Nigel.
Here is the line that blows up

Try (watch out for word wrap as this should be two lines):

MyShortcut.TargetPath = """C:\Program
Files\Symantec\pcAnywhere\awhost32.exe"""
MyShortcut.Arguments = """C:\Documents and Settings\All Users\Application
Data\Symantec\pcAnywhere\Hosts\Network, Cable, DSL.BHF""" & " /C /D"

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top