I found the following on an old thread to open up shortcuts, this helped with a certain issue I was having in opening up local command prompt, the problem is I'm just starting out with VBA and I'd like to know how can I take this and pass arguments to the command prompt window? I went into the documentation of the .DoIt since I read it was the FolderItem.Verbs.Item(0).DoIt is the function that actually opens command prompt, but I'm not exactly certain how to pass an argument into it even after reading the documentation.
Any help is appreciated here.
As an end result I'm trying to get a username after clicking the commandbutton, inputting that user name and running commands. I already understand how to get an input and how to store/pass the input. But I need to know how to send those inputs to command prompt once it's opened.
Any help is appreciated here.
As an end result I'm trying to get a username after clicking the commandbutton, inputting that user name and running commands. I already understand how to get an input and how to store/pass the input. But I need to know how to send those inputs to command prompt once it's opened.
VBA Code:
Sub OpenFile()
Dim FileName As Variant
Dim FolderItem As Object
Dim FolderPath As Variant
Dim oFolder As Object
Dim oShell As Object
FolderPath = [B]"C:\Documents and Settings\Admin.ADMINS\Desktop"[/B]
FileName = [B]"Solitaire.lnk"[/B]
Set oShell = CreateObject("Shell.Application")
Set FolderItem = oShell.Namespace(FolderPath).ParseName(FileName)
FolderItem.Verbs.Item(0).DoIt
End Sub