Kinook Software Forums

Go Back   Kinook Software Forums > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-10-2005, 09:20 AM
craign craign is online now
Registered User
 
Join Date: 03-30-2005
Location: Canada
Posts: 1
Project VBScript Stopped working

I've been using Project script code that I'm pretty sure I sliced out of one of the examples, to search for the existence of a log file and delete it if it exists. Anyway it worked great and then stopped. I've had to comment it out and make sure that I physically delete it prior to the build.

' delete the file if it exists
'If vbld_FSO.FileExists(logFile) Then
'MsgBox "Deleting log file '" + logFile + "' from vbld_BuildStarting event (go to Script Editor, " + _
'"Project tab to view script code)."
' vbld_FSO.DeleteFile logFile, True
'End If


Any ideas?
-CN
Reply With Quote
  #2  
Old 08-10-2005, 01:59 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,706
Not really. I would start by debugging the script to verify that the logFile variable contains the correct filename. Then, perhaps use Process Explorer's [1] find handle functionality to see if something has the file open, preventing it from being deleted.

[1] http://www.sysinternals.com/Utilitie...sExplorer.html
Reply With Quote
  #3  
Old 08-14-2006, 12:18 PM
HippyCraig HippyCraig is online now
Registered User
 
Join Date: 07-27-2006
Location: Philly
Posts: 211
I got the code to work it is the way you where eval the log file.


' delete the file if it exists
If vbld_FSO.FileExists(Application.ExpandMacros("%log File%")) Then
MsgBox "Deleting log file '" + "%logFile%" + "' from vbld_BuildStarting event (go to Script Editor, " + _
"Project tab to view script code)."
vbld_FSO.DeleteFile Application.ExpandMacros("%logFile%"), True
MsgBox("Found It, deleted!!!!")
Else
MsgBox("Did not Find It")
End If
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 09:29 AM.


Copyright 1999-2019 Kinook Software, Inc.