Jump to content

Dosya Oluşturma


FLaky
 Share

Recommended Posts

Mrb arkadaşlar..Istediğim dizinde uzantısız bi dosya oluşturmak istiyorum dosyada herhangi bi veri olmıycak sadece uzantısız bi dosya olacak..Elimde bununla ilgili bi VBScript kodu war onunla yapabiliyorum ancak autoitle yapmak istiyorum..

 

VBScript kodları

[spoiler]

On Error Resume Next


'Declare global variables

Dim objFSO :

Dim objFile


'Instantiate objects

Set objFSO = CreateObject("Scripting.FilesystemObject")


'Loop through subfolders in C:\Users

For Each objSub in objFSO.GetFolder("C:\Users").SubFolders


'Confirm that folders are not system folders

If objSub.Name <> "All Users" And objSub.Name <> "Default" And objSub.Name <> "Default User" And objSub.Name <> "Public"Then


'Create necessary subdir

If Not objFSO.FolderExists(objSub & "\AppData\Roaming\Adobe\AIR") Then

objFSO.CreateFolder objSub & "\AppData\Roaming\Adobe\AIR"

End If


'Create file indicating acceptance of the EULA

Set objFile = objFSO.CreateTextFile(objSub & "\AppData\Roaming\Adobe\AIR\eulaAccepted", True)


'Close file

objFile.Close


'Create file indicating disabling of updates

Set objFile = objFSO.CreateTextFile(objSub & "\AppData\Roaming\Adobe\AIR\UpdateDisabled", True)


'Close file

objFile.Close


End If


Next

 

[/spoiler]

Link to comment
Share on other sites

  • Editor

Help dosyasında mevcut.

 

 

#include <File.au3>
If Not _FileCreate("C:\file") Then
    MsgBox(4096, "Error", " Error Creating/Resetting log.      error:" & @error)
EndIf
 
Link to comment
Share on other sites


;VA On Error Resume Next


;Declare global variables

Dim $objFSO $:

Dim $objFile


;Instantiate objects

 $objFSO = ObjCreate("Scripting.FilesystemObject")


;Loop through subfolders in C:\Users

For $objSub in $objFSO.GetFolder("C:\Users").SubFolders


;Confirm that folders are not system folders

If $objSub.Name <> "All Users" And $objSub.Name <> "Default" And $objSub.Name <> "Default User" And $objSub.Name <> "Public"Then


;Create necessary subdir

If Not $objFSO.FolderExists($objSub & "\AppData\Roaming\Adobe\AIR") Then

$objFSO.CreateFolder ($objSub & "\AppData\Roaming\Adobe\AIR")

EndIf


;Create file indicating acceptance of the EULA

 $objFile = $objFSO.CreateTextFile($objSub & "\AppData\Roaming\Adobe\AIR\eulaAccepted", 1)


;Close file

$objFile.Close()


;Create file indicating disabling of updates

 $objFile = $objFSO.CreateTextFile($objSub & "\AppData\Roaming\Adobe\AIR\UpdateDisabled", 1)


;Close file

$objFile.Close()


EndIf


Next

au3 şeklinde düzenlendi

Link to comment
Share on other sites

Tek satır iş için bu kadar koda gerek yok, pairs dostumuz gayet güzel bir örnek vermiş hem çevirdiğiniz kodlar pek de çalışacak gibi durmuyor ayrıca karışık.

 

pairs dostumuzun kodları kısa dogru ,ben sadece vbs kodunu au3 çevirmek istedim

bu kadar uzun koda gerçekten gerek yok yani

haklısın SimpsoN_Bart dostum

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...