Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass password to shell command

Status
Not open for further replies.

Wrathchild

Technical User
Aug 24, 2001
303
US
I can open a database via the shell command, but is there a way to pass a password also?

sample Shell command:
Shell Chr(34) & strExePath & Chr(34) & " " & Chr(34) & strPath & strFileName & Chr(34) & strCommand, vbMinimizedFocus
 
I'm not sure about a database password, but there are switches for use with integrated security:
[tt]
"C:\Program Files\Microsoft Office\Office\MSAccess.exe" "C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb" /wrkgrp "C:\Windows\System\MySystem.mdw" /user "JoeBlow" /pwd "wolBeoJ"
[/tt]

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
thanks VBslammer, but I think my situation is different; here is the actual Shell command I'm passing:

Shell Chr(34) & "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" & Chr(34) & " " & Chr(34) & "C:\My Data\Secured.mdb", vbMinimizedFocus

this will open the database but will be sitting at the password prompt
 
I figured it out:

Shell Chr(34) & "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" & Chr(34) & " " & Chr(34) & "C:\My Data\Secured.mdb" & Chr(34)& "/pwd mypassword" , vbMinimizedFocus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top