| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Windows Script Host
Hello Forum!
I hope you can help me with this little prob: I use the following code to create a *.htm document in C:\blah.htm but how do i save the file on the desktop? Dim fso, htmfile Set fso = Wscript.CreateObject("Scripting.FileSystemObject") filespec = "c:\blah.htm" Set htmFile = fso.CreateTextFile(filespec, True) htmFile.WriteLine("<html>") htmFile.WriteLine("<head>") htmFile.WriteLine("<title>Test</title>") htmFile.WriteLine("</head>") htmFile.WriteLine("<body>") htmFile.WriteLine("test") htmFile.WriteLine("</body>") htmFile.WriteLine("</html>") htmFile.Close something like: filespec = DESKTOP(blah.asp) but i dont know the syntax. Plz help Regards M Kruger |
|
#2
|
||||
|
||||
|
just change the path to something like this
Code:
C:\Documents and Settings\<username>\Desktop |
|
#3
|
|||
|
|||
|
yeah, i know its where its located.
But the username changes from user to user?!? Is there any way of retreaving the username then? or...? |
|
#4
|
||||
|
||||
|
So capture the username and add it to the path.
Code:
Username = Request.Form("Username")
path = "C:\Documents and Settings\" & Username & "\Desktop"
|
|
#5
|
|||
|
|||
|
hehe, im writing windows script host. not ASP.
Im looking for a command like server.mappath just to the windows desktop |
|
#6
|
||||
|
||||
|
each user has their own desktop.
Unless you do Code:
path = "C:\Documents and Settings\All Users\Desktop" Then it would exist on all the users desktops for that computer. |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Windows Script Host |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|