excel2016双击无法打开xlsx文件的解决方法

网上基本提供的方法就是修改注册表的一个地方,可是我的还是不行,后来找到资料还有一个地方,最后将两个地方都修改了,最后成功双击打开文件。

1、打开注册表编辑器“regedit”;
2、定位到如下项目“HKEY_CLASSES_ROOT\Excel.Sheet.12\shell\Open\command”;
3、编辑原有的内容,在最后添加”%1”.
如:原参数为”C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE”
则:新参数为”C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE” “%1”
1、按下win+R后,输入regedit后回车,进入注册表编辑器。
2、在左边的列表里定位到HKEY_Current_User\Software\Microsoft\Office\16.0\excel文件夹
3、把这个excel文件夹直接重命名为excel.old

Powershell上传大文件到子目录下

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client.Runtime\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type -Path "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client.Publishing\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.Publishing.dll"
Add-Type -Path "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client.Search\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.Search.dll"
Add-Type -Path "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client.DocumentManagement\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.DocumentManagement.dll"

#Set parameter values
$SiteURL="https://one.sharepoint.com/"
$SourceFilePath="D:\Files\TM1.xlsx"
$TargetFolderRelativeURL ="/Shared Documents"
$User = "jz@one.com"
$Password = "P@ssword"  | ConvertTo-SecureString -AsPlainText -Force

#Bind to site collection
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
$Ctx.Credentials = $Credentials

Try {
    #Setup the context
    $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Ctx.Credentials = $Credentials

    #Get the Target Folder to upload
    $Web = $Ctx.Web
    $Ctx.Load($Web)
    $TargetFolder = $Web.GetFolderByServerRelativeUrl($TargetFolderRelativeURL)
    $Ctx.Load($TargetFolder)
    $Ctx.ExecuteQuery() 

    #Get the source file from disk
    $FileStream = ([System.IO.FileInfo] (Get-Item $SourceFilePath)).OpenRead()
    #Get File Name from source file path
    $SourceFileName = Split-path $SourceFilePath -leaf  
    $TargetFileURL = $TargetFolderRelativeURL+"/"+$SourceFileName

    #Upload the File to SharePoint Library Folder
    $FileCreationInfo = New-Object Microsoft.SharePoint.Client.FileCreationInformation
    $FileCreationInfo.Overwrite = $true
    $FileCreationInfo.ContentStream = $FileStream
    $FileCreationInfo.URL = $TargetFileURL
    $FileUploaded = $TargetFolder.Files.Add($FileCreationInfo)  
    $Ctx.ExecuteQuery()  

    #Close file stream
    $FileStream.Close()
    Write-host "File '$TargetFileURL' Uploaded Successfully!" -ForegroundColor Green
}
catch {
    write-host "Error Uploading File to Folder: $($_.Exception.Message)" -foregroundcolor Red
}

PowerShell上传文件到SharePoint子目录下

今天客户有一个需求,需要每天定时产生的报表文件上传SharePoint服务器上,网上找了资料,可以上传到相应的根目录下,就是不能上传到子目录下,测试了很多方法都不行,最后在下班的路上通过手机找到了相关资料,进行了一顿修改后,成功将文件放置到客户SharePoint的指定目录下。
原文连接(英文

如果Windows服务器上没有安装过Sharepoint,那就需要安装一个SharePoint Server 2016 Client Components SDK,安装之后需要确定两个DLL文件的对应位置,在执行PowerShell脚本的时需要用到的,具体可以参考我脚本。

#Add references to SharePoint client assemblies and authenticate to Office 365 site – required for CSOM
#Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
#Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type -Path "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client.Runtime\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.Runtime.dll"

#Specify tenant admin and site URL
$User = "jzh@one.com"
$SiteURL = "https://one.sharepoint.com/sites/Partners/"
$Folder = "D:\username\test\"
$DocLibName = "Documents"
$FolderName = "Analytics"
$Password = "P@ssword"  | ConvertTo-SecureString -AsPlainText -Force

#Bind to site collection
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
$Context.Credentials = $Creds

#Retrieve list
$List = $Context.Web.Lists.GetByTitle($DocLibName)
$Context.Load($List.RootFolder)
$Context.ExecuteQuery()

#Retrieve folder
$FolderToBindTo = $List.RootFolder.Folders
$Context.Load($FolderToBindTo)
$Context.ExecuteQuery()
$FolderToUpload = $FolderToBindTo | Where {$_.Name -eq $FolderName}

#Upload file(s)
Foreach ($File in (dir $Folder -File))
{
    $FileCreationInfo = New-Object Microsoft.SharePoint.Client.FileCreationInformation
    $FileCreationInfo.Overwrite = $true
    $FileCreationInfo.Content = [System.IO.File]::ReadAllBytes($File.FullName)
    $FileCreationInfo.URL = $List.RootFolder.ServerRelativeUrl + "/" + $FolderName + "/" + $File.Name
    $UploadFile = $List.RootFolder.Files.Add($FileCreationInfo)
    $Context.Load($UploadFile)
    $Context.ExecuteQuery()
}

解决Excel 2016无法直接打开文件的问题

新安装的OFFICE 2016发现从邮件中、微信中都无法直接打开Excel文件,查询了解决方法有2个,大家可以试试看。

1、修改注册表,位置:计算机\HKEY_CLASSES_ROOT\Excel.Sheet.12\shell\Open\command,在最后添加一下“%1”的参数,如果原来有其他参数“DDE”之类的删除,最后的结果为

"C:\Program Files\Microsoft Office\Root\Office16\EXCEL.EXE" "%1"

2、在选项-->高级中取消“忽略使用动态数据交换(DDE)的其他应用程序”前的勾选。

Windows远程桌面连接出现CredSSP的解决方法

今天远程桌面的时候失败了,出现以下提示"CredSSP加密Oracle”错误

于是上网找解决办法,经过测试,该方法是可行的。

首先,在控制台中输入regedit,打开注册表

接着按照以下目录依次展开HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\,接着在System目录下创建两级文件夹,也就是新建项,CredSSP\Parameters,

然后再Parameters下右键-》新建DWORD 32位,修改名称AllowEncryptionOracle。

双击修改值为2.

之后去试一下远程连接桌面,应该就可以了。

RDP 优化操作 微软远程桌面 开启显卡加速、60FPS、USB设备重定向

有一说一,Windows自带的远程桌面服务(RDP)非常优秀,不考虑云服务(可以自己搭建)的情况下,在表现上可以胜过任意一款第三方远程控制软件(包括且不限于VNC、Teamviwer……),毕竟是原生功能。

RDP本身是可以无显卡运行的,显示远程桌面的时候并不调用显卡,可以做一些基本的管理操作。最近研究了一下怎样将提升RDP的性能,开启显卡加速(OpenGL,DX支持),提高传输帧率(默认30fps,设置为60fps),以及USB设备重定向(将客户端的USB设备挂载到远程主机,不需要USB Network Gateway)

Continue reading "RDP 优化操作 微软远程桌面 开启显卡加速、60FPS、USB设备重定向"

Windows系统下的免费SFTP服务器软件

FreeSSHD SFTP Server
其实是有2个软件,一个是freeSSHd,一个是freeFTPd。
freeSSHd 的 sftp,所有用户只有一个 sftp 的主目录。
freeFTPd 的 sftp,可以给不同的用户设定不同的目录。

freeSSHd 可以设置系统账号、公钥、密码的登录方式,不像 xlight 只能在密码、公钥里二选一。
freeFTPd 可以设置系统账号、密码、匿名的登录方式。

Continue reading "Windows系统下的免费SFTP服务器软件"

执行yum update出现Cannot allocate memory错误

CentOS 6在进行yum update后出现如下错误,

Error in POSTIN scriptlet in rpm package libstdc++-4.4.7-23.el6.x86_64
error: Couldn't fork %post(libstdc++-4.4.7-23.el6.x86_64): Cannot allocate memory
  Updating   : pcre-7.8-7.el6.x86_64                                                                                                                                                                                                     5/239
Error in POSTIN scriptlet in rpm package pcre-7.8-7.el6.x86_64
error: Couldn't fork %post(pcre-7.8-7.el6.x86_64): Cannot allocate memory
  Updating   : grep-2.20-6.el6.x86_64                                                                                                                                                                                                    6/239
Error in POSTIN scriptlet in rpm package grep-2.20-6.el6.x86_64
error: Couldn't fork %post(grep-2.20-6.el6.x86_64): Cannot allocate memory
  Updating   : cpio-2.10-13.el6.x86_64                                                                                                                                                                                                   7/239
Error in POSTIN scriptlet in rpm package cpio-2.10-13.el6.x86_64
error: Couldn't fork %post(cpio-2.10-13.el6.x86_64): Cannot allocate memory
  Updating   : sysvinit-tools-2.87-6.dsf.el6.x86_64                                                                                                                                                                                      8/239
  Updating   : tcp_wrappers-libs-7.6-58.el6.x86_64                                                                                                                                                                                       9/239
Error in POSTIN scriptlet in rpm package tcp_wrappers-libs-7.6-58.el6.x86_64
error: Couldn't fork %post(tcp_wrappers-libs-7.6-58.el6.x86_64): Cannot allocate memory
  Updating   : 1:findutils-4.4.2-9.el6.x86_64                                                                                                                                                                                           10/239
Error in POSTIN scriptlet in rpm package 1:findutils-4.4.2-9.el6.x86_64
error: Couldn't fork %post(findutils-1:4.4.2-9.el6.x86_64): Cannot allocate memory
  Updating   : sqlite-3.6.20-1.el6_7.2.x86_64                                                                                                                                                                                           11/239
Error in POSTIN scriptlet in rpm package sqlite-3.6.20-1.el6_7.2.x86_64
error: Couldn't fork %post(sqlite-3.6.20-1.el6_7.2.x86_64): Cannot allocate memory
  Updating   : nss-softokn-3.14.3-23.3.el6_8.x86_64                                                                                                                                                                                     12/239
Error in POSTIN scriptlet in rpm package nss-softokn-3.14.3-23.3.el6_8.x86_64
error: Couldn't fork %post(nss-softokn-3.14.3-23.3.el6_8.x86_64): Cannot allocate memory
  Updating   : libtasn1-2.3-6.el6_5.x86_64                                                                                                                                                                                              13/239
Error in POSTIN scriptlet in rpm package libtasn1-2.3-6.el6_5.x86_64
error: Couldn't fork %post(libtasn1-2.3-6.el6_5.x86_64): Cannot allocate memory
  Updating   : p11-kit-0.18.5-2.el6_5.2.x86_64                                                                                                                                                                                          14/239
Error in POSTIN scriptlet in rpm package p11-kit-0.18.5-2.el6_5.2.x86_64
error: Couldn't fork %post(p11-kit-0.18.5-2.el6_5.2.x86_64): Cannot allocate memory
  Updating   : p11-kit-trust-0.18.5-2.el6_5.2.x86_64                                                                                                                                                                                    15/239
Error in POSTIN scriptlet in rpm package p11-kit-trust-0.18.5-2.el6_5.2.x86_64
error: Couldn't fork %post(p11-kit-trust-0.18.5-2.el6_5.2.x86_64): Cannot allocate memory
  Updating   : less-436-13.el6.x86_64                                                                                                                                                                                                   16/239
  Updating   : gmp-4.3.1-13.el6.x86_64                                                                                                                                                                                                  17/239
Error in POSTIN scriptlet in rpm package gmp-4.3.1-13.el6.x86_64
error: Couldn't fork %post(gmp-4.3.1-13.el6.x86_64): Cannot allocate memory
  Updating   : device-mapper-persistent-data-0.6.2-0.2.rc7.el6.x86_64                                                                                                                                                                   18/239
  Updating   : 1:make-3.81-23.el6.x86_64                                                                                                                                                                                                19/239
Error in POSTIN scriptlet in rpm package 1:make-3.81-23.el6.x86_64
error: Couldn't fork %post(make-1:3.81-23.el6.x86_64): Cannot allocate memory
  Updating   : gdbm-1.8.0-39.el6.x86_64                                                                                                                                                                                                 20/239
Error in POSTIN scriptlet in rpm package gdbm-1.8.0-39.el6.x86_64
error: Couldn't fork %post(gdbm-1.8.0-39.el6.x86_64): Cannot allocate memory
  Updating   : plymouth-core-libs-0.8.3-29.el6.centos.x86_64                                                                                                                                                                            21/239
Segmentation fault

找了一圈后,找到结局方案,具体如下:
编辑 /etc/sysctl.conf ,改vm.overcommit_memory=1,然后sysctl -p 使配置文件生效

vi /etc/sysctl.conf

修改/添加

vm.overcommit_memory=1

Esc 退出 :wq 保存
然后sysctl -p 使配置文件生效

CentOS 6下域名yum命令报错YumRepo Error: All mirror URLs are not using

CentOS6已经在2020年11月30日停止维护了。centos官方停止了对centos6的所有更新,并且下架了包括官方所有的centos6源,目前阿里、163、清华等centos6源已无法使用。

CentoS 6 停止维护更新日期:2020年11月30日

CentOS 7 停止维护更新日期:2024年6月

CentOS 8 停止维护更新日期:2029年5月

1、输入下面命令,切换到root用户

su root

2、备份配置文件,防止以后出错后不好修复

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

3、执行下面命令,新建CentOS-Base.repo配置,复制粘贴如下命令

vim /etc/yum.repos.d/CentOS-Base.repo
[centos-office]
name=centos-office
failovermethod=priority
baseurl=https://vault.centos.org/6.10/os/x86_64/
gpgcheck=1
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6

4、按Ecs键后:wq保存并退出

5、正常啦~