Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can access USERPROFILE variable ???

Status
Not open for further replies.

Dylan

MIS
Aug 27, 1998
109
US
Iam opening a batch file as Output and using Print command to create a external batch file and would like to be able to use the USERPROFILE variable .

EX I have a ftp script in a text file called ftpscr.txt

I would like to be able to create a line in this file like
this that would use the PC's userprofile variable ...

ftp -s:%userfprofile%\ftpscr.txt

instead of hard coding it like

ftp -s:c:\My Documnets\ftpscr.txt


Tahnks again for any help with this ...




Tom Moran
Lansing, Michigan
 
Either print this:
"ftp -s:""%userprofile%\ftpscr.txt"""
Or this:
"ftp -s:""" & Environ("userprofile") & "\ftpscr.txt"""


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top