• 欢迎访问奇跡の海网站,本站不上传任何资源,所有资源均来自于网络,欢迎加入奇跡の海~!奇跡の海-WordPress QQ群
  • 本站下载资源为网络上收集整理而来,并且以计算机技术研究交流为目的,版权归原作者所有,仅供大家参考,学习,不存在任何商业目的与商业用途.
  • 本站系统镜像均来自于官方原版,ed2k可视为P2P下载链接。所有操作系统默认均为试用版,如有正版密钥可以有效激活,本站不提供任何激活和相关服务。

AutoIt3(au3)源码-首次登陆时检测是否存在D盘并移动我的文档等到D盘

AutoIT3 奇跡の海 2年前 (2017-11-03) 639次浏览 已收录 0个评论 扫描二维码

简介

部署时不可用

首次登陆时调用(首次进桌面也行),可智能识别是否存在D盘,存在则移动“文档、图片、音乐、视频、收藏、下载、桌面”到D盘,不存在则自动退出程序。
AutoIt3(au3)源码-首次登陆时检测是否存在D盘并移动我的文档等到D盘

源代码

If FileExists("d:\") Then
	
        DirMove("C:\Users\Administrator\Desktop","D:\Users\Desktop",1)
        DirMove("C:\Users\Administrator\Documents","D:\Users\Documents",1)
        DirMove("C:\Users\Administrator\Downloads","D:\Users\Downloads",1)
        DirMove("C:\Users\Administrator\Favorites","D:\Users\Favorites",1)
        DirMove("C:\Users\Administrator\Music","D:\Users\Music",1)
        DirMove("C:\Users\Administrator\Pictures","D:\Users\Pictures",1)
        DirMove("C:\Users\Administrator\Videos","D:\Users\Videos",1)
        FileMove("C:\Users\desktop.ini","D:\Users\desktop.ini",1)
		
		DirRemove("C:\Users\Administrator\Desktop",1)
        DirRemove("C:\Users\Administrator\Documents",1)
        DirRemove("C:\Users\Administrator\Downloads",1)
        DirRemove("C:\Users\Administrator\Favorites",1)
        DirRemove("C:\Users\Administrator\Music",1)
        DirRemove("C:\Users\Administrator\Pictures",1)
        DirRemove("C:\Users\Administrator\Videos",1)
        FileDelete("C:\Users\desktop.ini")
		
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","My Video","REG_SZ","D:\Users\Videos")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","My Pictures","REG_SZ","D:\Users\Pictures")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop","REG_SZ","D:\Users\Desktop")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Favorites","REG_SZ","D:\Users\Favorites")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","My Music","REG_SZ","D:\Users\Music")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","{374DE290-123F-4565-9164-39C4925E467B}","REG_SZ","D:\Users\Downloads")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Personal","REG_SZ","D:\Users\Documents")
		
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","My Video","REG_EXPAND_SZ","D:\Users\Videos")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","My Pictures","REG_EXPAND_SZ","D:\Users\Pictures")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Desktop","REG_EXPAND_SZ","D:\Users\Desktop")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Favorites","REG_EXPAND_SZ","D:\Users\Favorites")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","My Music","REG_EXPAND_SZ","D:\Users\Music")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","{374DE290-123F-4565-9164-39C4925E467B}","REG_EXPAND_SZ","D:\Users\Downloads")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Personal","REG_EXPAND_SZ","D:\Users\Documents")
		
		MsgBox(0, "", "移动成功,注销或重启后生效。")
Else
		Exit 
EndIf

版权声明:本站所有文章和资源使用CC BY-NC-SA 4.0协议授权发布 , 转载应当以相同方式注明文章来自“SeaOMC.COM->AutoIt3(au3)源码-首次登陆时检测是否存在D盘并移动我的文档等到D盘!在下边可以分享本文哦!
喜欢 (0)
[]
分享 (0)
奇跡の海
关于作者:
一个WordPress菜鸟!
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址