Categories
Welcome Center
Education & Development
Discussions
Certification Preparation
Recent Posts
Groups
Free Resources
Ebooks
Free Workshops
Trending Certifications Infographic
Infosec Training
IT & Security Training
Live Boot Camps
Security Awareness Training
About Infosec Institute
Home
Discussions
Off Topic
Multiple environment variables as a filename?
/usr
Is there a way to do this? When I try two, it tends to complain and wants to use one.
I want something like %USERNAME%&(machine name)
Anyone know if there is an environment variable to grab the machine name?
Find more posts tagged with
Save $250 on 2025 certification boot camps from Infosec!
Book now with code EOY2025
Button
Comments
RussS
In what context is that?
If you are in a Netware environment the machine is called the domain. With XP there are a few registry hacks needed to create a single sign-on - is that what you are trying to achieve?
Webmaster
Type set in the command prompt to list the current variables. COMPUTERNAME is one of them. Try this to combine two:
set NewVar=%username%\%Computername%
and then type set again and check if NewVar is listed with the correct value.
ajs1976
%computername%
To put both together use %username%%computername%
from a command promt I typed "dir > c:\%username%%computername%" and it created the text outfile with the name usernamecomputername.
Webmaster
Yes indeed. I was using that \ because I assumed you wanted it for logon purposes and turned around the username and computername
It's purpose is not to combine the two vars.
/usr
Windows 2000 doesn't allow remote backups of the system state using ntbackup. I haven't been able to find a workaround so far.
I'm writing a small batch file to send to the end users, which will back up their system state and send it to a network drive. I need the environment variable for the names of the backup.
I was originally using the account name, but some machines use the same account, so I'm going to use the machine name as well in order to distinguish between the two.
Thanks for the %computername% information. I didn't think to try that and I couldn't find a list anywhere.
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of
INFOSEC Boot Camps
$250
OFF
Use code
EOY2025
to receive $250 off your 2025 certification boot camp!
BROWSE BOOT CAMPS