Creating files in specific folder

I have a little problem - I am trying to create a bat file in a specific folder with another batch file

echo How many hours must go from startup to shutdown? set input= set /p input= Timer: SET /A Sekunder = %input% * 3600 SET startupfolder=%SystemDrive%\%HOMEPATH%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\AutoShutdown.bat echo %startupfolder% echo c:\windows\system32\shutdown -s -f -t %Sekunder% > %startupfolder% pause

Am I doing anything wrong...?

-------------Problems Reply------------

Read at Redirection page:

Note, any long filenames must be surrounded in "double quotes".

echo Hvor mange timer skal der gaa fra startup til shutdown?
set input=
set /p input= Timer:
SET /A Sekunder = %input% * 3600
SET startupfolder=%SystemDrive%\%HOMEPATH%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\AutoShutdown.bat
echo %startupfolder%
echo c:\windows\system32\shutdown -s -f -t %Sekunder% > "%startupfolder%"
pause

Use %userprofile%

If you echo out your path, as you do but didn't read, you'll see you have c:\\etc.

Ok... The problem was that it needed "" 's in front, and behind the folder name as it contained spaces :)

My program is now fully working :p Ty anyways :)

Category:windows Views:24 Time:2018-05-03

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.094 (s). 11 q(s)