Diana (Cda) Posted March 18, 2008 Share Posted March 18, 2008 (edited) I was so sure there was something like "If NotFileExists" then .... for those cases where we need to do a file operation _only_ if that file doesn't already exist. But I can't find anything in the help file nor is there anything in the forums; so I'm guessing (and hoping) it's just a case of not having the right terminology so my searches aren't turning up anything. I need to create a shortcut to a script in the QuickLaunch folder _only_ if the shortcut isn't already there. Was wondering how to do that in terms of syntax. Thanks! Edited March 18, 2008 by Diana (Cda) Link to comment Share on other sites More sharing options...
weaponx Posted March 18, 2008 Share Posted March 18, 2008 If NOT FileExists() Link to comment Share on other sites More sharing options...
BigDod Posted March 18, 2008 Share Posted March 18, 2008 or if FileExists("c:\test.txt") = 0 Then MsgBox(0,"","Thefile does not exist") EndIf Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Diana (Cda) Posted March 18, 2008 Author Share Posted March 18, 2008 Thanks, guys! Just now, I stumbled upon the answer. I get it now. It just takes putting a NOT in front! Everything is simple once you know how. Here's part of the script. It's quite a bit longer, but it's all the same thing, so just copying a part of it here:; ----- USB flash drive. Change the drive letter below whenever it changes when you're given a new computer.--------------- $PORTABLEdriveLetter = "E:\" ; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ; ===== Firefox Portable v2.0.0.3: ================================================================ If Not FileExists (@UserProfileDir & "\SendTo\Firefox Portable.lnk") Then FileCreateShortcut(@UserProfileDir & "\Favorites\01\0WXP\APP- Firefox Portable v2.0.0.3\FirefoxPortable.exe", @UserProfileDir & '\SendTo\Firefox Portable.lnk','','""') ; ===== Irfanview: ================================================================================ If Not FileExists (@UserProfileDir & "\SendTo\Irfanview.lnk") Then FileCreateShortcut($PORTABLEdriveLetter & "\APPS\IMAGE\img, Irfanview v3.85\APP- Irfanview v3.85\i_view32.exe", @UserProfileDir & '\SendTo\Irfanview.lnk','','""') etc. ... I used my recently learned syntax of creating a shortcut and it's really neat. Whenever I start a new contract, I'll not have to copy the shortcuts, then open the SendTo folder and paste, I'll just need to click on the script. And with my also recently learned knowledge of variables, just need to make the one small change at the top from "E" to whatever new drive letter is needed. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now