1

I can compile my visual basic project Project1.vbp into exe through this command

Set objWshScriptExec=objShell.Exec("cmd.exe /S /C cd ""C:\Program Files (x86)\Microsoft Visual Studio\VB98"" & vb6/make ""C:\Users\Ankit\Desktop\New folder (5)\Project1.vbp"" ""C:\Users\Ankit\Desktop\New folder (5)\Project1.exe""")

But when I take

p="C:\Program Files (x86)\Microsoft Visual Studio\VB98"
m="C:\Users\Ankit\Desktop\New folder (5)\"

And try to execute this command

Set objWshScriptExec=objShell.Exec("cmd.exe /S /C cd "p" & vb6/make "m"Project1.vbp"" "m"Project1.exe""")

It results in error.

kindly provide me some solution to correct this command to compile the project to exe.

1

1 Answer 1

2

You have to concatenate strings using & and also enclose your paths in " quotes. (Inside a string, quotes are escaped as "".)

Set d = objShell.Exec("cmd.exe /S /C cd """ & p & """ & vb6/make """ _
    & m & "Project1.vbp"" """ & m & "Project1.exe""")
Sign up to request clarification or add additional context in comments.

1 Comment

See stackoverflow.com/a/29649804/603855 if you want more structure/less noise in building commands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.