Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Space in the printer name
Message
De
27/10/1999 08:56:21
 
 
À
27/10/1999 08:11:26
Information générale
Forum:
Windows
Catégorie:
Impression
Divers
Thread ID:
00281644
Message ID:
00282172
Vues:
29
>>If quote encapsulation isn't working as I suggested, the shared printer name resolves the same way as an LFN; you can use the API call GetShortPathName once to find the valid short name and use it. Quote encapsulation works for me, though.
>
>Can you give me the following with the appropriate syntax:
>
>NET USE LPT1 \\MY LONG COMPUTER NAME\MYPRINTERNAME

From a Win32 system, try the folowiung VFP snippet:
DECLARE INTEGER GetShortPathName IN Win32API ;
	STRING  @cLongPath, ;
	STRING  @cShortPathBuff, ;
	INTEGER nBuffSize
cpathToCOnvert = "\\MY LONG COMPUTER NAME\MYPRINTERNAME" +CHR(0)
cBuf= space(511)
nBufSize = 511
nShortSize = GetShortPathName(cPathToConvert,@cBuf,@nBufSize)
IF nShortSize > 0
	? LEFT(cBuf,nShortSize)
ELSE
	? 'Burp!  Couldn't do it'
ENDIF
That will return a usable UNC in 8.3 file formats. Try using the short name on the NET USE command from the DOS systems.

Problems:

(1) If this is real DOS or Win3.x and uses a Pre Win95 release of DOS (like MSDOS 6.22 or earlier), it doesn't contain the LFN support at all, and the above may not work. Workaround: Install the DOS subsystem from Win95 or Win98 as DOS by making a Win9x boot disk and copying files from the the Windows\Command directory of Win9x to provide the necessary command line services.

(2) If you have very old NDIS drivers, they may not support LFNs properly - this is an easier fix; update the NDIS drivers.

(3) If it's DOS, your machine name can't exceed 12 characters and must adhere to DOS file naming conventions (NO SPACES, or multiple . in the name, etc.) - UNC support for non-standard machine names didn't originate pre-Win95, other than to use the DOS subsystem from Win9x, or redo the server's NetBIOS name, you're stuck on direct access to an difficult UNC from older DOS.

(4) If the printer name rather than the machine name is a problem, an easy workaround is available from NT. NT can have multiple shares of the same device. Define a share name for the printer that's legal in addition to the one giving your DOS boxes heartburn...

(56) If the host isn't NT, you can still work around it by sharing it to another WinNT or Win9x box, and then having THAT system share its printer connection with a legal UNC for DOS.

(6) Arrive next to the PC with a screwdriver, soldering iron and a supply of chips. This may frighten the machine into behaving rather than risking radical surgery.

(7) And when's the last time you attended mass and went to confession? If you aren't Catholic, my apologies for asking the wrong question - when did you last perform a ritual sacrifice of an end-user to TPTB?

(8) Rename the machine and share. And promise to never, ever use LFNs with real DOS ever again.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform