[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Space in windows' user path

From: Ian McCallion
Subject: Fwd: Space in windows' user path
Date: Sat, 16 Feb 2019 18:25:22 +0000

On Sat, 16 Feb 2019 at 11:27, Nicholas Jankowski <address@hidden> wrote:
>> /split_user_name_dir/(...)\AppData\Local\Temp\octave-help-KloqyA"
>> Could you give me some workaround?
> Does anyone know if that location is set during the startup script?

No. It is inherited from the environment variables in force when the
startup script is called

> Is there a way to force octave to use the 8.3 name for that part?

I don't know.

> Maybe a .bat that manually redefines the user_home environment variable then 
> starts octave?

As I observed recently on this mailing list, I do not believe
user_home is used under windows and is set up unnecessarily by the vbs
script, hence there should be no problem with launching Octave when
the username contains a blank. The problem only occurs in functions
such as help (I have no idea if there are more) that create temporary

Hence a neat solution is to convert the values of environment
variables TMP and TEMP to their 8.3 values. I have found this example
code on the internet, but don't have time at the moment to check it
out. I will do so later if needed, If it works this could be usefully
added to octave.vbs, although maybe this is not necessary if Octave 5
will support blanks in paths.

Set fso=CreateObject("Scripting.FileSystemObject")

' Is object a file or folder?
If fso.FolderExists(WScript.Arguments(0)) Then
   'It's a folder
   Set objFolder = fso.GetFolder(WScript.Arguments(0))
   rtrn = InputBox("Here's your short path:", "SHORT PATH", objFolder.ShortPath)
End If

If fso.FileExists(WScript.Arguments(0)) Then
   'It's a file
   Set objFile = fso.GetFile(WScript.Arguments(0))
   rtrn = InputBox("Here's your short path:", "SHORT PATH", objFile.ShortPath)
End If

Cheers... Ian

reply via email to

[Prev in Thread] Current Thread [Next in Thread]