hi!
anybody help me please,
i write shutdown code,it ok but when i convert exe file shutdown code is not work.
my shutdown code is

shell "shutdown -s -t 30"

please help me thanks

I'm not sure of this but I think it might be a 'Permissions' issue, try running your EXE as Administrator and see if things are the same? (you may tell us what you get)

@echo of
:loop
shutdown -s -t "(number of seconds)" -c "(Your text here)"
goto :loop

works well as a .BAT file and the code above will leave the dialog box open no matter how many times they click the "X"

Simple, fun and annoying and most important harmless

From this you should be able to covert to a .EXE depending on what u use to make it.

Might work with visual studio once compiled and built

Doesn't work via..
notepad
notepad++

thank for your helping. I can do it now

how can i make such exe which can sutdown in a second

Use..

shutdown -s -t "1" -c "(Your text here)"

:) that's the idea of setting the time taken for it to execute the command, it wont be an instant power down since it will take a bit of time to process the request.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.