Вопрос

I want to format a drive from visual basic application. Can anybody help me with it ? I have tried shFormat(), but it is not completing my task. And If I Format my drive through CMD, it should be a background process for my application.

Это было полезно?

Решение

You could call a cmd from vba to execute the format command e.g.

Dim cmd_str As String
cmd_str = "cmd.exe /C format f:"
Call Shell(cmd_str, vbNormalFocus)

obviously the example above is for drive f:, change this as needed.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top