Batch file incorrect writing to txt file
Last answer on Nov 14, 2008 4:38:16 pm GMT System-One, on Nov 13, 2008 3:47:36 pm GMTHello dear friends,
I have some trouble writing some application data from windows to a .txt file located on a usb stick (E:/ cant even CD it), however when i relocate the log.bat on the C drive it works fine!
Can anyone spot my error i cant find out what im doing wrong.... here goes the code:
[code log.bat]
CD C:\Users\system-one\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
echo Computernaam: %COMPUTERNAME% >> %~d0\fi-pc.txt
echo Gebruikt door: %USERNAME% >> %~d0\fi-pc.txt
echo Datum: %date% >> %~d0\fi-pc.txt
echo. >> %~d0\fi-pc.txt
echo Programma's menu start: >> %~d0\fi-pc.txt
echo ----- >> %~d0\fi-pc.txt
DIR /b >> %~d0\fi-pc.txt
echo ----- >> %~d0\fi-pc.txt
echo. >> %~d0\fi-pc.txt
echo Program Files: >> %~d0\fi-pc.txt
echo ----- >> %~d0\fi-pc.txt
CD %programfiles%
Dir /b >> %~d0\fi-pc.txt
echo ----- >> %~d0\fi-pc.txt
echo -END- >> %~d0\fi-pc.txt
echo. >> %~d0\fi-pc.txt
echo. >> %~d0\fi-pc.txt
echo -NEW- >> %~d0\fi-pc.txt
echo. >> %~d0\fi-pc.txt
CD %~d0\
/code
It writes a text file with the dir data of the usb stick when launched from usb stick!?
Best Regards,
Noob
Configuration: Windows Vista Firefox 3.0.3

