NewGen Wannabe
NewGen Wannabe

Reputation: 1

(VBscript) Opening custom set Folder

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

Answers (1)

Hackoo
Hackoo

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

Related Questions