473,394 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

the 'getpath' command

hi,

I am trying to make my vb program find the path of the msn messenger
application (I want this to be done automatically on which ever computer it
is downloaded).
The code I use is returning the wrong path: that of the vb executable
itself.
Here's my code:

Dim fso
Dim newpath As String
Set fso = CreateObject("Scripting.FileSystemObject")
newpath = fso.GetAbsolutePathName("MSNMSGR.EXE")
Print newpath 'to check if it's working

any suggestions?
Thanks
Hala
Jul 17 '05 #1
3 4941
Perhaps it's because the executable and the messenger are in different
subdirectories. The problem is GetAbsolutePathName can only look up or down
the branch of the directory tree it's starting at. Try changing to the root
path before looking for messenger.

Sue

"hala" <tr*******@yahoo.com> wrote in message
news:bj**********@charm.magnus.acs.ohio-state.edu...
hi,

I am trying to make my vb program find the path of the msn messenger
application (I want this to be done automatically on which ever computer it is downloaded).
The code I use is returning the wrong path: that of the vb executable itself.
Here's my code:

Dim fso
Dim newpath As String
Set fso = CreateObject("Scripting.FileSystemObject")
newpath = fso.GetAbsolutePathName("MSNMSGR.EXE")
Print newpath 'to check if it's working

any suggestions?
Thanks
Hala

Jul 17 '05 #2
Regardless of your problem the FSO is out if you want it to work on
all machines, they could well have the sensible option of scripting
disabled.
So you might want to forget the FSO and read the registry yourself for
the information your after
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Curr entVersion\App
Paths\MSNMSGR.EXE

Geoff

"Suzette" <an**@worldnet.att.net> wrote in message news:<-W********************@comcast.com>...
Perhaps it's because the executable and the messenger are in different
subdirectories. The problem is GetAbsolutePathName can only look up or down
the branch of the directory tree it's starting at. Try changing to the root
path before looking for messenger.

Sue

"hala" <tr*******@yahoo.com> wrote in message
news:bj**********@charm.magnus.acs.ohio-state.edu...
hi,

I am trying to make my vb program find the path of the msn messenger
application (I want this to be done automatically on which ever computer

it
is downloaded).
The code I use is returning the wrong path: that of the vb

executable
itself.
Here's my code:

Dim fso
Dim newpath As String
Set fso = CreateObject("Scripting.FileSystemObject")
newpath = fso.GetAbsolutePathName("MSNMSGR.EXE")
Print newpath 'to check if it's working

any suggestions?
Thanks
Hala

Jul 17 '05 #3
> I am trying to make my vb program find the path of the msn messenger
application (I want this to be done automatically on which ever computer it is downloaded).
The code I use is returning the wrong path: that of the vb executable itself.
Here's my code:

Dim fso
Dim newpath As String
Set fso = CreateObject("Scripting.FileSystemObject")
newpath = fso.GetAbsolutePathName("MSNMSGR.EXE")
Print newpath 'to check if it's working

any suggestions?


Are you sure that is the filename you want to search for. I don't use
Messenger myself, but the executable name seems to be msmsgs.exe on my
system. (Or is "msn messenger" different than "Messenger" which came with my
WinXP system?)

Rick - MVP
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: nome | last post by:
as URL.getFile() and URL.getPath() seem allways to return the same value, wy did one introduce getPath() in 1.3? can i use both methods to get the full file name? I'd prefer getFile, because...
0
by: nome | last post by:
found the solution myself: getFile() returns path + query example: http://posting.google.com/post?cmd=post&name=myName getFile() returns post?cmd=post&name=myName getPath() only post
1
by: TEK | last post by:
Hello I'm wondering if anyone out there might give some input/suggestions/viewpoints around the Command pattern. In my case, the number one priority for using the pattern is undo support. Some...
8
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland...
2
by: micahstrasser | last post by:
I have been trying for days to send a command to the command prompt through the shell() function in vb.net. For some reason it is not working. Here is the code: Private Sub Button1_Click(ByVal...
34
by: Roman Mashak | last post by:
Hello, All! I'm implementing simple CLI (flat model, no tree-style menu etc.). Command line looks like this: <command> <param1> <param2> ... <paramN> (where N=1..4) And idea is pretty simple: ...
13
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple...
0
by: czerwww | last post by:
Can someone please help me? I have class for database connection and I need set command.commandTimeout. How can I do that? Code: Imports System.Data.SqlClient Imports System.Data Public Class...
3
by: Connolly | last post by:
Hey there, new Python user here. Currently, I'm working on a project in Python for my college work, I chose to use Python since I heard of its great advantages, now for designing GUI's I'm using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.