Solved

How to auto insert domain name into a command line?

Posted on 2009-05-13
4
260 Views
Last Modified: 2012-05-06
Does anyone know how to insert a domain name into a command line for a script? Example: \\ServerName\Users\%UserName%\

I tried using %domainname% but is doesn't work.

I am trying to use universal scripts for DFS, Example: \\%domainname%\Public Share
0
Comment
Question by:infinitybs
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
Andrej Pirman earned 500 total points
Comment Utility
Into Command prompt type

SET

and it will list all available environent variables. You might find usefull some like these:
%USERDNSDOMAIN%
%USERDOMAIN%
0
 
LVL 1

Author Comment

by:infinitybs
Comment Utility
This is what I was looking for, but it will not allow me to use %USERDNSDOMAIN% in folder redirection GPO. I am trying to redirect the My Docs folder to \\%USERDNSDOMAIN%\UserData$\. It works when I type it into run, but not when I insert it into root path under folder redirection. Do you know a way to get this to work?
0
 
LVL 1

Expert Comment

by:Opytk
Comment Utility
Is the domain going to change based upon the person?

So something like \\servername.domain\users\%username% does not work?
0
 
LVL 18

Expert Comment

by:Andrej Pirman
Comment Utility
Instead of putting it in under folder redirection, you can do it also by creating/modifying a startup script, which will do something you like. Batch script is run on user's computer and will recognise all environment variables.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction: Sometimes when I receive a call from my users to solve their problems it is very difficult for me to found their computer IP address. Even finding their computer Host to provide remote support can be a problem.  So I resorted to Goo…
This is a fairly complicated script that will install the required prerequisites to install SCCM 2012 R2 on a server.  It was designed under the functional model in order to compartmentalize each step required, reducing the overall complexity.  The …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now