Set WS = CreateObject("WScript.Shell")
WScript.Echo WS.Environment("User")("temp")
WScript.Echo WS.Environment("System")("temp")
WScript.Echo WS.ExpandEnvironmentStrings("%temp%")
WScript.Echo WS.ExpandEnvironmentStrings("%APPDATA%")
WScript.Echo WS.ExpandEnvironmentStrings("%USERPROFILE%")
Dim fso
A = WS.ExpandEnvironmentStrings("%HOMEPATH%")
B = WS.ExpandEnvironmentStrings("%APPDATA%")
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile A & "\1.txt", B
==============================代码======================================
Dim WshShell
Set WshShell = CreateObject("Wscript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Source_Path_file= "C:" & WshShell.ExpandEnvironmentStrings ("%HOMEPATH%") & "\1.txt"
Dis_Path=WshShell.ExpandEnvironmentStrings ("%APPDATA%") & "\"
fso.CopyFile Source_Path_file,Dis_Path
=============================代码结束====================================
这个才是正确的。望采纳!
呵呵,还是有待深入学习啊,已经有人给你做出解答了