Reputation: 1
File = "FireFox"
Set ObjShell= CreateObject("WScript.Shell")
objShell.ShellExecute "C:\David\" & File, "", "", "Open", 1
This script works for me !
But my question is :
How can I change it so that it gets the Username of the user and puts it in the directory instead of David
Upvotes: 0
Views: 48
Reputation: 18827
You should write something like that :
File = "Firefox"
strUser = CreateObject("WScript.Network").UserName
wscript.echo strUser
wscript.echo "C:\"& strUser &"\"& File
Upvotes: 1