0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Python/BAT を使ったフォルダ削除とアプリランチャー.exe の作成方法

Posted at
ninjatrader_starter.py
import os
import subprocess

# Clear NinjaTrader cache
os.system('del /q "%USERPROFILE%\\Documents\\NinjaTrader 8\\cache\\*.*"')
os.system('for /d %F in ("%USERPROFILE%\\Documents\\NinjaTrader 8\\cache\\*") do rd /s /q "%F"')

os.system('del /q "%USERPROFILE%\\Documents\\NinjaTrader 8\\db\\cache\\*.*"')
os.system('for /d %F in ("%USERPROFILE%\\Documents\\NinjaTrader 8\\db\\cache\\*") do rd /s /q "%F"')

# Launch NinjaTrader
subprocess.Popen(r'"C:\Program Files\NinjaTrader 8\bin\NinjaTrader.exe"')
python -m pip install pyinstaller
pyinstaller --onefile --icon="C:\Program Files\NinjaTrader 8\bin\NinjaTrader.ico" ninjatrader_starter.py

bat ver.

del /q "%USERPROFILE%\Documents\NinjaTrader 8\cache\*.*"
for /d %%F in ("%USERPROFILE%\Documents\NinjaTrader 8\cache\*") do rd /s /q "%%F"

del /q "%USERPROFILE%\Documents\NinjaTrader 8\db\cache\*.*"
for /d %%F in ("%USERPROFILE%\Documents\NinjaTrader 8\db\cache\*") do rd /s /q "%%F"

"%ProgramFiles%\NinjaTrader 8\bin\NinjaTrader.exe"

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?