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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script error when file not in same folder as script

Status
Not open for further replies.

gurner

Technical User
Feb 13, 2002
522
US
I have this script that prompts you to define one of the application switches, then asks you to pick a file to chuck towards the application, but if the file is anywhere but in the same folder that the script is run from it errors with file not found from the last line

the script is
------------------------------------------------
dim response1

Set Wshshell = CreateObject("Wscript.Shell")

response1 = inputbox("please define the switch first then pick the file", "Machine name")

set oFO = CreateObject("SAFRCFileDlg.FileOpen")
oFO.OpenFileOpenDlg

Wshshell.run "audit --" & response1 & " --input=" & oFO.FileName & " --log=audit.log"
----------------------------------------------

cheers

Gurner
 
The commondialog control of vb, the opendialog changes the current directory. I think is the problem here.

In the commondialog control of vb you can avoid change the current directory with the flags property of the control. (Value = 8), but I don't know if it's applicable on this case



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top