Jump to content
Sign in to follow this  
senatin

FileExists() Seems not working at all

Recommended Posts

senatin
#Region DETECTOR
If FileExists(@systemDir & '\hmm.txt')Then
   ConsoleWrite("Your Good To Go")
Else
   FileCopy(@scriptdir & 'hmm.txt',@SystemDir & 'hmm.txt',9)
   ConsoleWrite("Your Not Allowed To use This")
   Exit
EndIf

#EndRegion

I dont understand Why this part of code doesnt execute as I want it be.

I save a hmm.txt into system32 and run this code but always give me "Your Not Allowed to use This"
even i added the FileCopy and let him paste it to dir and run again and again with same result.
I think I quite dont understand how FileExists or @systemDir works.
Please help me

Share this post


Link to post
Share on other sites
RTFC

Well, for one, there's a backslash missing between @scriptdir/@systemdir and your filename in the FileCopy statement.

Edited by RTFC

Share this post


Link to post
Share on other sites
senatin
Quote

 

#Region DETECTOR
If FileExists(@SystemDir & "\hmm.txt")Then
   ConsoleWrite("Your Good To Go")
Else
   FileCopy(@scriptdir & "\hmm.tx",@SystemDir & "hmm.txt",9)
   ConsoleWrite("Your Not Allowed To use This")
   Exit
EndIf

 

Quote

now its working
but why other post in forum they use ' instead of "
' seems not working at all

ARG its actually SysWOW64 and not System32 took me lot of tries before it works
 

Edited by senatin

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×