Re: Expected Statement error
- From: systemtek <duncan@xxxxxxxxxxxxxxx>
- Date: Fri, 16 Nov 2007 01:42:29 -0800 (PST)
On 15 Nov, 18:18, Tom Lavedas <tglba...@xxxxxxx> wrote:
On Nov 15, 12:20 pm, "Paul Randall" <paulr...@xxxxxxxxxxxx> wrote:
"systemtek" <dun...@xxxxxxxxxxxxxxx> wrote in message
news:61e83bd0-9957-4384-b7f3-9d44d75e9d6a@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sorry if this appears twice, i might have pressed Cancel and not
Post...
Hi All
I am trying to run the following vbs script, but get a "Expected
Statement" error on Line 7 at Char 1
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strCmd=chr(34) & "assoc .TIF=TIFImage"
strCmd=chr(34) & "ftype tifimage.document=" _
& "C:\Program Files\Common Files\Microsoft Shared\MODI
\11.0\MSPVIEW.EXE" _
& "{%}1"
End If
What i am trying to run in the above script is the following :-
assoc .TIF=TIFImage
ftype tifimage.document="C:\Program Files\Common Files\Microsoft
Shared
\MODI\11.0\MSPVIEW.EXE" "%1"
I think maybe my problems are lying around the "%1" at the end and
how
i am trying to pass that over, not sure i got that bit right. I
have
tried various things, hense why it looks a bit messy. Any ideas ?
After reading all the replies to this post, I'm guessing that you want
to run a sequence of commands, and that you have verified that if you
run each of these commands in a command prompt window, you get the
desired result. But it is not clear to me whether the %1 is an actual
parameter or a place holder for a parameter being passed to a .BAT
file, or something from a command line 'For' loop (my DOS knowledge is
getting rusty). Maybe you want to build a batch file and execute it.
It is difficult to help you if you don't give us enough information.
-Paul Randall
Actually, the %1 is a replacable argument, but not for a batch
processor. The OP is trying to alter the registry to create a file
association using the two command line utilities ASSOC.exe and
FYPE.exe. This can be done by altering the registry directly, but
using the utilities both simplifies the process and is less prone to
errors. I've done it both ways, but tend to use the command line
approach manually and the registry hack in a script.
Tom Lavedas
===========http://members.cox.net/tglbatch/wsh/- Hide quoted text -
- Show quoted text -
Thanks for all the replys, but i still cant get it to work. As people
have said what i am trying to do is to set the file association
for .TIF's to MSPVIEW.EXE the problem i have is that for some reason
on a lot of our PC's the TIF has no association to it at all when we
look at it. I have tried the above scripts on a few different PC's
here and the script appears to run with no errors but it does not set
the association up for some reason, we are all domain admins so its
nothing permission related. I am wondering if it might be better to
somehow do it the other way by accessing the registry via a vbs
script, i have a .REG file that i know works on the PC's, maybe this
would be the better option to try to put in a vbs script ?
The reg file i have is :
[HKEY_CLASSES_ROOT\.tif]
"Content Type"="image/tiff"
@="MSPaper.Document"
[HKEY_CLASSES_ROOT\.tif\MSPaper.Document]
[HKEY_CLASSES_ROOT\.tif\MSPaper.Document\ShellNew]
[HKEY_CLASSES_ROOT\.tif\OpenWithList]
[HKEY_CLASSES_ROOT\.tif\OpenWithList\ois.exe]
@=""
[HKEY_CLASSES_ROOT\.tif\PersistentHandler]
@="{58F2E3BB-72BD-46DF-B134-1B50628668FB}"
I not really played around with adding reg stuff to a vbs script so i
dont really know where to start on this.
Thanks
.
- References:
- Expected Statement error
- From: systemtek
- Re: Expected Statement error
- From: Paul Randall
- Re: Expected Statement error
- From: Tom Lavedas
- Expected Statement error
- Prev by Date: Re: How to get Err.Description
- Next by Date: Re: Script to change text in large file
- Previous by thread: Re: Expected Statement error
- Next by thread: Re: Adding holidays to multiple users calender
- Index(es):
Relevant Pages
|
Loading