Skip to content

The plugin fail to work on Windows #61

Description

@vds2212

On windows there are some problems one of them is that: fnmodify(path, ':p:8') return the part of the path that already exists.
i.e.
if C:\Users\Public\vim_temp_15128.txt does not exist but C:\Users\Public does then: fnmodify('C:\Users\Public\vim_temp_15128.txt', ':p:8') returns C:\Users\Public.

I suppose you are using the 8.3 format to avoid space in the path and to avoid the quote problem in the runas syntax:

runas /noprofile /user:MT-BRU-2-0102\ladmin "C:\Windows\system32\cmd.exe /k copy /Y C:\Users\Public\vim_temp_9676.txt C:\Users\vds\Desktop\hosts"

Maybe the alternative syntax is a fit that doesn't requiers the 8.3 syntax.

runas /noprofile /user:MT-BRU-2-0102\ladmin "C:\Windows\system32\cmd.exe /k copy /Y \"C:\Users\Public\vim_temp_9676.txt\" \"C:\Users\vds\Desktop\hosts\""

I'll create a Pull Request to proposes my changes.

Remark:

To convert to the 8.3 syntax you need to know what are the files in the directory.
Suppose you have in the folder the files:

  • abcdefgh1.txt
  • abcdefgh2.txt
  • abcdefgh3.txt

Convert abcdefg3.txt in 8.3 will depend of the presence of abcdefg1.txt.

Actually I believe the 8.3 name is created when the file is created in the folder or moved into the folder.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions