Code Comments
Programming Forum and web based access to our favorite programming groups.I am having a problem with the shell command in vb6: Shell "f:\filecode\filecode.exe /p " & pword & " /f ""temp1.doc"" /s " & sp & " /d" When I run this, the application calls for a value for the /p parameter. pword is defined in the program as "password" so it should be ok. Note that the /s parameter is passed across ok (sp is defined as "f:\temp folder") If I have Shell "f:\filecode\filecode.exe /p ""password"" /f ""temp1.doc"" /s " & sp & " /d" the application runs ok. Can anyone help please? Is there a more foolproof way of calling an outside application and passing parameters as variables? Thanks Chris
Post Follow-up to this messageOn Thu, 28 Apr 2005 17:52:14 +1000, "inquirer" <noreply@noreply.com> wrote: >I am having a problem with the shell command in vb6: > >Shell "f:\filecode\filecode.exe /p " & pword & " /f ""temp1.doc"" /s " & sp >& " /d" S$ = Chr$(34) + pword + Chr$(34) Shell "f:\filecode\filecode.exe /p " & S$ & " /f ""temp1.doc"" /s " & sp & " /d" You seem to be missing the quotes ( they are Chr$(34) ) Your best bet is to build the 'command' as a string - then MsgBox it - it makes debugging a lot easier
Post Follow-up to this messageThanks, that fixed it "J French" <erewhon@nowhere.uk> wrote in message news:427098a8.262686213@news.btclick.com... > On Thu, 28 Apr 2005 17:52:14 +1000, "inquirer" <noreply@noreply.com> > wrote: > sp > > S$ = Chr$(34) + pword + Chr$(34) > Shell "f:\filecode\filecode.exe /p " & S$ & " /f ""temp1.doc"" /s " & > sp & " /d" > > You seem to be missing the quotes ( they are Chr$(34) ) > > Your best bet is to build the 'command' as a string > - then MsgBox it > - it makes debugging a lot easier
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.