RobertK Posted September 3, 2007 Share Posted September 3, 2007 (edited) Hi there, I just started learning this language, and I have a sample script in front of me. I've already got several years of experience in PHP and that kind of languages, and this looks a little similar. I have this code: $StartProg = ("C:\windows\system32\mshta.exe") $ArgMen = ("C:\test\hello.hta") $WorkDir = ("C:\test") if FileExists( "C:\AUTEST\v11.osx" ) Then Run ( $StartProg & " " & $ArgMen, $WorkDir ) Else if FileExists( "C:\AUTEST" ) Then Sleep(10) Else DirCreate( "C:\AUTEST" ) EndIf ElseIf The only problem is, I recon that this could be done a little easier by checking if the FileExists functions returns false and then create a directory. For example: $StartProg = ("C:\windows\system32\mshta.exe") $ArgMen = ("C:\test\hello.hta") $WorkDir = ("C:\test") if FileExists( "C:\AUTEST\v11.osx" ) Then Run ( $StartProg & " " & $ArgMen, $WorkDir ) Else if ( FileExists( "C:\AUTEST" ) == False ) Then DirCreate( "C:\AUTEST" ) EndIf ElseIf But this doesn't seem to work, it doesn't create a directory. Thanks in advance, Robert EDIT: sorry for the lame title, first I had a problem with something like "Missing EndIf" but that problem is solved, I wrote ElseIf in stead of EndIf. But I can't change my title Edited September 3, 2007 by RobertK [font="Verdana"]I've gone to find myself. If I get back before I return, please keep me here.[/font] Link to comment Share on other sites More sharing options...
ChrisL Posted September 3, 2007 Share Posted September 3, 2007 If NOT fileExists() then .... [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
RobertK Posted September 3, 2007 Author Share Posted September 3, 2007 (edited) If NOT fileExists() then ....Thank you for the fast reply.It works Edited September 3, 2007 by RobertK [font="Verdana"]I've gone to find myself. If I get back before I return, please keep me here.[/font] Link to comment Share on other sites More sharing options...
ChrisL Posted September 3, 2007 Share Posted September 3, 2007 Thank you for the fast reply.It works Welcome [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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