vbs脚本在重定向方面替换用户什么?
嗨,我想知道如何在目录中替换用户?这是我的代码:
Dim oFS,oFl
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFl = oFSO.GetFile("myexe.exe")
oFl.Move "C:\Users\myusername\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
我不知道要替换“ myusername”以与任何计算机一起使用。感谢您的帮助
Hi i wanted to know how to replace the user in a directory ? this is my code :
Dim oFS,oFl
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFl = oFSO.GetFile("myexe.exe")
oFl.Move "C:\Users\myusername\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
I dont know what to replace "myusername" to work with any computer. Thanks for the help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在寻找当前登录的用户,则可以使用类似的壳体对象从Windows环境变量中将其拉到。
或者,您可以这样从网络对象中提取它。
拥有用户名后,看起来您只是在用文件路径构建一个字符串以运行一个应用程序,您可以使用该应用程序。
If you're looking for the currently logged on user you could pull it from a windows environment variable using the shell object like this.
Or you could pull it from the network object like this.
Once you have the username it looks like you're just building a string with the file path it to run an application, which you could use concatenation for.