0

Hi all

i whant to backup the following,

dim sourcefolders(2)
sourcefolders(0) = "C:\Documents and Settings\%username%\My Documents"
sourcefolders(1) = "C:\Documents and Settings\%username%\Desktop"
sourcefolders(2) = "C:\Documents and Settings\%username%\Favorites"

but the %username% is unkown for the script,
it is written in VBS and i what to get it work for 75 users in a network.

i don´t what to write a script for every person in the network.

does someone know what to do,

if you need more of the script PM me.

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by Salem
0

Run cmd.exe and type ' set ' at the prompt.
You'll get a whole bunch of "VAR=VALUE" strings printed. One of these will be USERNAME.

These (collectively) are called environment variables. All good languages at least have an API to access these variables.

In C for example, it would be char *user = getenv("USERNAME"); In Perl my $user = $ENV{"USERNAME"}; Since I dont know VBScript, you should be able to research the answer from here.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.