Open a command prompt window, type set
and press key RETURN or ENTER to run this command. You get displayed all predefined environment variables with their current values. You can see TEMP, USERPROFILE and USERNAME.
Windows command line has a help. The command to get help is help
, yes really. Try it out! You need help on command CD, enter in command prompt window help cd
or alternatively cd /?
. You need help on command SET and START, run help set
or set /?
and help start
or start /?
. All internal commands of cmd.exe
and nearly all console applications support the parameter /?
and output 1 or more help pages on running the command with this parameter.
You need a better overview of standard Windows commands? See Microsoft's command-line reference and SS64's command line reference.
I assume that sriram
is your user account and s.d.vaidyanathan
is the user account of someone else. By default a standard user has no permissions to access folders and files in a different user's profile than the own profile since Windows Vista. That means, you logged in as sriram
can't access the files and folders of C:\Users\s.d.vaidyanathan
because of missing permissions to do so. It would be necessary to use command Runas to run the batch file with account s.d.vaidyanathan
.
@echo off
rem Execute lsmon.exe from license1.1.4 in my folder for temporary
rem files and folders and write the log file also into this folder.
"%TEMP%\license1.1.4\lsmon.exe" testprovilic.muc.company >"%TEMP%\license1.1.4\usage.log"
Note: Double quotes must be used around path AND file name. Just double quoting parts of a file name with path may or may not work depending on error correction and how the application is written. For details see answer on set environment variables with spaces.
See also the Microsoft article Using command redirection operators.
And regarding right usage of command START not really needed here see for example answer on How to call a batch file in the parent folder of current batch file?