vb스크립트에서 cmd를 사용한 간단한 동작
참고로 주석은 ' 이나 : REM 으로 시작하면된다.
' 파일지우기 Set WshShell = WScript.CreateObject("WScript.Shell") return = WshShell.Run ("cmd /c del /q /s c:\test\test.txt",0 ,true)
Dim oShell
Set oShell = WScript.CreateObject ("WSCript.shell")
If WScript.Arguments.length =0 Then
Set objShell = CreateObject("Shell.Application")
'Pass a bogus argument with leading blank space, say [ uac]
objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
Else
oShell.Run "install.vbs"
End If
' If WScript.Arguments.length =0 Then
' Set objShell = CreateObject("Shell.Application")
' 'Pass a bogus argument with leading blank space, say [ uac]
' objShell.ShellExecute "wscript.exe", Chr(34) & _
' WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
'Else
'Add your code here
Set oShell = WScript.CreateObject("WScript.Shell")
'copy required file'
Return = oShell.Run("cmd /c xcopy c:\test.txt %windir%\system32",0,true)
'install pcscan'
'Return = oShell.Run("cmd /c c:\comtrue\pcscan\extra\ctrinst.exe pcscan", 0, true)
'self delete'
'Set oFso = CreateObject("Scripting.FileSystemObject") : oFso.DeleteFile Wscript.ScriptFullName, True
'End If
Dim oShell
Set oShell = WScript.CreateObject ("WSCript.shell")
If WScript.Arguments.length =0 Then
Set objShell = CreateObject("Shell.Application")
'Pass a bogus argument with leading blank space, say [ uac]
objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
Else
oShell.Run "install.vbs"
End If
' If WScript.Arguments.length =0 Then
' Set objShell = CreateObject("Shell.Application")
' 'Pass a bogus argument with leading blank space, say [ uac]
' objShell.ShellExecute "wscript.exe", Chr(34) & _
' WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
'Else
'Add your code here
Set oShell = WScript.CreateObject("WScript.Shell")
'copy required file'
Return = oShell.Run("cmd /c xcopy c:\test.txt %windir%\system32",0,true)
'install pcscan'
'Return = oShell.Run("cmd /c c:\comtrue\pcscan\extra\ctrinst.exe pcscan", 0, true)
'self delete'
'Set oFso = CreateObject("Scripting.FileSystemObject") : oFso.DeleteFile Wscript.ScriptFullName, True
'End If
파일생성 batch
@echo off
SET foo = "test"
for /l %%x in (1, 1, 10) do (
echo %%x
echo test > %%x.txt
)
'미분류' 카테고리의 다른 글
VirtualBox 오류해결: VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT (0) | 2021.05.11 |
---|---|
signtool.exe returned error 0x800700C1 (0) | 2017.10.12 |
the superclass javax.servlet.http.httpservlet was not found on the java build path (0) | 2017.08.06 |
분리된 ISO 파일합치기 (0) | 2017.04.28 |
visual studio 솔루션정리 배치 (0) | 2017.03.30 |