hi people.
i have a script that obtains the owner of a file. i can echo the owner on the screen, and i can write the owner into a textfile.
the thing is, another script needs to send a email to the owner. so the owner have to be a variable. How do i do that?
ok, here is a piece of code that ECHO's the owner and writes it to c:\owner.txt
FOR /F "skip=5 tokens=5* delims=\ " %%A IN ('DIR/A-D/Q "%OwnedFile%" ^| FIND /V "(s)"') DO ECHO.%%A >> c:\owner.txt
i need the owner in a variable. ive tried the following:
FOR /F "skip=5 tokens=5* delims=\ " %%A IN ('DIR/A-D/Q "%OwnedFile%" ^| FIND /V "(s)"') DO SET FILEOWNER=%%A
so now, FILEOWNER should include the owner, but when i trie to echo the variable it doesnt do anything:
ECHO the owner is %FILEOWNER%
am i doing something wrong?
( maybe another solution. i can write the owner into a text file, maybe its easy to make a script that gets the name out of the text file and puts it into a variable? )
i hope someone can help me, im struggling along time with this problem..
greetings,
Andre
i have a script that obtains the owner of a file. i can echo the owner on the screen, and i can write the owner into a textfile.
the thing is, another script needs to send a email to the owner. so the owner have to be a variable. How do i do that?
ok, here is a piece of code that ECHO's the owner and writes it to c:\owner.txt
FOR /F "skip=5 tokens=5* delims=\ " %%A IN ('DIR/A-D/Q "%OwnedFile%" ^| FIND /V "(s)"') DO ECHO.%%A >> c:\owner.txt
i need the owner in a variable. ive tried the following:
FOR /F "skip=5 tokens=5* delims=\ " %%A IN ('DIR/A-D/Q "%OwnedFile%" ^| FIND /V "(s)"') DO SET FILEOWNER=%%A
so now, FILEOWNER should include the owner, but when i trie to echo the variable it doesnt do anything:
ECHO the owner is %FILEOWNER%
am i doing something wrong?
( maybe another solution. i can write the owner into a text file, maybe its easy to make a script that gets the name out of the text file and puts it into a variable? )
i hope someone can help me, im struggling along time with this problem..
greetings,
Andre