Discussion:
VBscript replacement for FTYPE command
(too old to reply)
Bill Burke
2004-12-15 19:28:20 UTC
Permalink
Hello,

Happy Holidays!

I have a need to add some lines to an existing login script to change the FTYPE
for a certain set of applications. I am wondering if there's a VBS replacment
for the FTYPE command? Please advise.

Thanks in advance,
Bill Burke
***@2burkes.com
Torgeir Bakken (MVP)
2004-12-15 20:10:42 UTC
Permalink
Post by Bill Burke
I have a need to add some lines to an existing login script to
change the FTYPE for a certain set of applications. I am wondering
if there's a VBS replacment for the FTYPE command? Please advise.
Hi

No FTYPE functionallity is builtin to VBScript, but is just really
a registry write.

So from a VBScript, here are two ways to do the command

FTYPE PerlScript=perl.exe "%1"

1)
Using RegWrite:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
oShell.RegWrite "HKCR\PerlScript\Shell\Open\Command\", "perl.exe ""%1"""
'--------------------8<----------------------


2)
Using a callout to the FTYPE command from your VBScript:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
oShell.Run "%comspec% /c FTYPE PerlScript=perl.exe ""%1""", 0, True
'--------------------8<----------------------
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
William Hymen
2004-12-16 12:53:44 UTC
Permalink
Hi Torgeir,

I'm putting together a formal scripting class for
my company (finding hardcopy materials, a decent instructor, ...etc)
Do you know if the Microsoft Press is printing any good material
on paper? e.g. that 1328 page guide?
Thanks in advance-

Bill
Post by Torgeir Bakken (MVP)
Post by Bill Burke
I have a need to add some lines to an existing login script to
change the FTYPE for a certain set of applications. I am wondering
if there's a VBS replacment for the FTYPE command? Please advise.
Hi
No FTYPE functionallity is builtin to VBScript, but is just really
a registry write.
So from a VBScript, here are two ways to do the command
FTYPE PerlScript=perl.exe "%1"
1)
'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
oShell.RegWrite "HKCR\PerlScript\Shell\Open\Command\", "perl.exe ""%1"""
'--------------------8<----------------------
2)
'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
oShell.Run "%comspec% /c FTYPE PerlScript=perl.exe ""%1""", 0, True
'--------------------8<----------------------
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
http://www.microsoft.com/technet/scriptcenter/default.mspx
Torgeir Bakken (MVP)
2004-12-17 09:44:20 UTC
Permalink
Post by William Hymen
Hi Torgeir,
I'm putting together a formal scripting class for
my company (finding hardcopy materials, a decent instructor, ...etc)
Do you know if the Microsoft Press is printing any good material
on paper? e.g. that 1328 page guide?
Hi

Yes, the MS Scripting Guide is available on paper, and covers
admin scripting in a very good way I think.
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Loading...