zoukankan      html  css  js  c++  java
  • xp_cmdshell用WinRAR压缩和解压文件

    --压缩文件: a 压缩,-ep 从名称中排除路径
    declare	@sql nvarchar(200)
    set @sql = '"D:\Program Files\WinRAR\WinRAR.exe" a -ep F:\a.rar F:\a.txt'
    exec master..xp_cmdshell @sql
    
    --解压文件: e 解压,-o+ 覆盖
    declare	@sql nvarchar(200)
    set @sql = '"D:\Program Files\WinRAR\WinRAR.exe" e -o+ F:\a.rar F:\'
    exec master..xp_cmdshell @sql
    
    --解压文件: e 压缩, -o-跳过,-inul 禁止所有消息。
    declare	@sql nvarchar(200)
    set @sql = '"D:\Program Files\WinRAR\WinRAR.exe" e -o- -inul F:\a.rar F:\'
    exec master..xp_cmdshell @sql
    
    
    
    ---附:
    ---xp_cmdshell的启用、禁用
    -- To allow advanced options to be changed.
    EXEC sp_configure 'show advanced options', 1
    GO
    -- To update the currently configured value for advanced options.
    RECONFIGURE
    GO
    -- To enable the feature.
    EXEC sp_configure 'xp_cmdshell', 1 --1为启用,0为禁用
    GO
    -- To update the currently configured value for this feature.
    RECONFIGURE
    GO
    
  • 相关阅读:
    内置函数(少量)
    画国旗(尺寸不标准)
    测试题——程序
    乱码笔记2--字典
    列表
    课堂笔记 ——————乱
    如何利用pip安装国内镜像源
    pip常用指令
    pip卸载
    pip简介
  • 原文地址:https://www.cnblogs.com/gdjlc/p/2237043.html
Copyright © 2011-2022 走看看