473,320 Members | 1,870 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,320 software developers and data experts.

Getshortpathname()

i have been using this function to get the short path name.. and has been working succsefully.. but recently.. after i installed exchange 2007 server on windows 2003 Os... the function seems to be acting funny not gving me the desired result..

Function ShortPath(sPath As String) As String
Dim ShortPathName As String
If Right$(sPath, 1) <> "\" Then
sPath = sPath & "\"
End If
ShortPathName = Space$(255)
nRetVal = GetShortPathName(sPath, ShortPathName, Len(ShortPathName))
If (nRetVal = ERROR_INVALID_PARAMETER) Then
MsgBox "GetShortPathName Failed"
End If
ShortPath = Left$(ShortPathName, Len(Trim$(ShortPathName)) - 2)
End Function

thought this call works everywhere else perfectly..it seems to be failing only on system installed with exchange 2007 ...

can anyone help meout with this.. or an equivalent method to get short path name..
Feb 27 '07 #1
1 2078
Killer42
8,435 Expert 8TB
Have you checked that your parameters are identical in each case?
Mar 1 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: dotNetDave | last post by:
How do you convert a path like this: C:\Program Files to C:\PROGRA~1 In .NET? I have a program I have to call via a command line and calling one of it's parameters I have to give it a...
2
by: Rick Brandt | last post by:
Is anyone using the fHandleFile() from "The Access Web" site in a Terminal Server environment? I just discovered today that it doesn't work for me. Even though I can double-click a PDF file and...
4
by: James Geurts | last post by:
Hi all, I'm trying to convert a string representing a path to Dos 8.3 notation. The code that I have works fine if the path exists, but it will not work if the path does not exist. I am looking...
14
by: Allen | last post by:
Greetings, I need to pass a file path to an application. This file path contains long directory and file names. The target application, pdftotext.exe, only accepts short directory and file...
2
by: Sakharam Phapale | last post by:
Hi All, I have following code which is not working Declare Function GetShortPathName Lib "kernel32" _ Alias "GetShortPathNameA" (ByVal lpszLongPath As String, _ ByRef lpszShortPath As...
5
by: Sakharam Phapale | last post by:
Hi All, I am using an API function, which takes file path as an input. When file path contains special characters (@,#,$,%,&,^, etc), API function gives an error as "Unable to open input file"....
1
by: Greg Larsen | last post by:
Does anyone know how I can get the Alternate Name for a file using VB? You know that short file names that are displayed when you issue the "DIR /X" DOS command. I can get the long file name...
8
by: =?Utf-8?B?dHVtYQ==?= | last post by:
I have a win32 application that creates a directory in Users's Application Data directory (Example: c:\users\<username>\Local Settings\Application Data\MyFolder) and writing application specific...
23
by: =?Utf-8?B?TWlrZTE5NDI=?= | last post by:
This is an example that is supposed to work in VB http://support.microsoft.com/kb/175512/en-us After spending a couple of hours downloading and installing VB Express 2008 after someone told me it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.