4
How to open a file from any extension, such as - Paçoca.legalcara
an executable like - algo.exe
using CMD or VB?
Note: The path must be relative, which means that all are in the same folder
4
How to open a file from any extension, such as - Paçoca.legalcara
an executable like - algo.exe
using CMD or VB?
Note: The path must be relative, which means that all are in the same folder
3
For use in the same folder and using relative paths for calling the executable (something.exe) passing the argument/file(Paçoca.legalcara)
In VB
Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
sScriptDir = oFSO.GetParentFolderName(WScript.ScriptFullName)
set shell=CreateObject("Shell.Application")
shell.ShellExecute "algo.exe",sScriptDir+"\Paçoca.legalcara z -S -v ",sScriptDir, , 1
set shell=nothing
Obs.: For testing purposes, they were thus renamed:
filing cabinet madplay.exe
for algo.exe
aqruivo Redemption Song.mp3
for Paçoca.legalcara
In CMD
pushd "caminho_de_sua_pasta" && .\algo.exe ".\Paçoca.legalcara" & popd
rem :: ou ..
pushd "caminho_de_sua_pasta" && start "" .\algo.exe ".\Paçoca.legalcara" & popd
rem :: ou ..
cd /d "caminho_de_sua_pasta" && .\algo.exe ".\Paçoca.legalcara"
rem :: ou ..
cd /d "caminho_de_sua_pasta" && start "" .\algo.exe ".\Paçoca.legalcara"
3
In VB you can use the arguments, for example call the Notepad:
System.Diagnostics.Process.Start("notepad.exe", "c:\arquivo.txt")
And the cmd would be something like:
start "notepad.exe" "c:\arquivo.txt"
Browser other questions tagged visual-basic-6 batch cmd
You are not signed in. Login or sign up in order to post.
Thanks for the help =)
– Christopher
@Guilhermenascimento Good afternoon! that part:
System.Diagnostics.Process.Start("notepad.exe", "c:\arquivo.txt")
isC#
nayVBs
– It Wasn't Me
@Itwasn'tme is actually VB.net, but yes the tag is about vb6, so this would not be correct. I’ll be editing soon, thanks
– Guilherme Nascimento