Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

shell problem
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



Report this thread to moderator Post Follow-up to this message
Old Post
inquirer
04-28-05 01:55 PM


Re: shell problem
On 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

Report this thread to moderator Post Follow-up to this message
Old Post
J French
04-28-05 01:55 PM


Re: shell problem
Thanks, 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



Report this thread to moderator Post Follow-up to this message
Old Post
inquirer
04-29-05 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:28 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.