FTYPE command in batch

  • Thread starter Thread starter Ian McAllen
  • Start date Start date
I

Ian McAllen

Hello,
i have a problem with file associations in a batch. When i
execute 'ftype artdoc=%systemroot%\artdoc.exe "%1"' on the
command line it works fine but if i execute the same
command in a logon script the "%1" option (open?) is not
there when i list the assciations using "ftype". It just
answers 'artdoc=c:\windows\artdoc.exe ""' and the document
associated to this type does not open immediately when
doubleclicking it.
 
Ian,

So an example of how this is normally done:

c:\>assoc .foo=FooType
..foo=FooType

c:\>ftype FooType=notepad %1
FooType=notepad %1

c:\>copy con foo.foo
ff
^Z
1 file(s) copied.

c:\>foo
'foo' is not recognized as an internal or external command,
operable program or batch file.

c:\>foo.foo
<sucessful launching of notepad with my file>

c:\>set PATHEXT=.foo;%PATHEXT%
c:\>foo
<sucessful launching of notepad with my file>


You have done the above steps and it works well from the command line and
explorer? But when you use it in a login script it fails to run properly?

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

--------------------
From: "Ian McAllen" <[email protected]>
Subject: FTYPE command in batch
Hello,
i have a problem with file associations in a batch. When i
execute 'ftype artdoc=%systemroot%\artdoc.exe "%1"' on the
command line it works fine but if i execute the same
command in a logon script the "%1" option (open?) is not
there when i list the assciations using "ftype". It just
answers 'artdoc=c:\windows\artdoc.exe ""' and the document
associated to this type does not open immediately when
doubleclicking it.
 
Back
Top