| View previous topic :: View next topic |
| Author |
Message |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Thu Sep 08, 2005 4:05 am Post subject: Run and shell open at same time |
|
|
How to fix this code ?
if %%ShutDown is not used i get error
| Code: | %%ShutDown = Shutdown.exe -L
%%ShutDown1 = rundll32.exe, user32.dll LockWorkStation
if @equal(%K,0)
runh %%ShutDown
else
if @equal(%K,0)
shell open, %%ShutDown1
else
if @equal(%K,-1)
dialog set,SB, Exiting...
stop
end
end
goto loop |
|
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Thu Sep 08, 2005 3:44 pm Post subject: |
|
|
Apparently your first and second conditions are identical, therefore after the first condition is met, the if statement goes directly to its end. Does this help?
| Code: |
%%ShutDown = Shutdown.exe -L
%%ShutDown1 = rundll32.exe, user32.dll LockWorkStation
if @equal(%K,0)
shell open, %%ShutDown1
runh %%ShutDown
elsif @equal(%K,-1)
dialog set,SB, Exiting...
stop
end
goto loop
|
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Fri Sep 09, 2005 1:20 pm Post subject: |
|
|
Nope now the %%ShutDown do not work...
This commands must to be seperated
I chose from combo to lock on command
Must be run only one at same time... |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Fri Sep 09, 2005 2:32 pm Post subject: |
|
|
I'm confused... What exactly are you trying to do?
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Fri Sep 09, 2005 3:07 pm Post subject: |
|
|
Hard to explain
The big problem here is i can not combine only one command to be used, Shutdown.exe only works with run and rundll32.exe command only works with shell open...
im trying to intergrate the rundll32.exe before i use external *.cmd file. |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Fri Sep 09, 2005 3:27 pm Post subject: |
|
|
I think I figured it out...
replace:
%%ShutDown1 = rundll32.exe, user32.dll LockWorkStation
with:
%%ShutDown1 = "rundll32.exe user32.dll, LockWorkStation"
Let me know...
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Fri Sep 09, 2005 4:40 pm Post subject: |
|
|
Nope
rundll32.exe, user32.dll LockWorkStation (opened from Windows run) PASSED
SHELL OPEN,rundll32.exe, user32.dll LockWorkStation PASSED
%%ShutDown1 = rundll32.exe, user32.dll LockWorkStation FAILED (and exit by it self)
Shell open, %%ShutDown1
or
%%ShutDown1 = rundll32.exe user32.dll, LockWorkStation (Windows Error can not run...)
Shell open, %%ShutDown1
Thanks for trying DEAD END |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Fri Sep 09, 2005 4:49 pm Post subject: |
|
|
Try putting quotes around the rundll32 command:
%%ShutDown1 = "rundll32.exe, user32.dll LockWorkStation"
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Fri Sep 09, 2005 4:53 pm Post subject: |
|
|
Running from empty script...
%%ShutDown1 = "rundll32.exe user32.dll, LockWorkStation" FAILED (Windows Error...)
Shell open, %%ShutDown1
-
%%ShutDown1 = "rundll32.exe, user32.dll LockWorkStation" FAILED (Windows Error)
Shell open, %%ShutDown1
-
%%ShutDown1 = rundll32.exe, user32.dll LockWorkStation FAILED (exit by it self)
Shell open, %%ShutDown1
-
%%ShutDown1 = rundll32.exe user32.dll, LockWorkStation FAILD (Windows Error...)
Shell open, %%ShutDown
Last edited by filip on Fri Sep 09, 2005 5:04 pm; edited 1 time in total |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Fri Sep 09, 2005 5:02 pm Post subject: |
|
|
What do you mean by "exit by itself"?
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Fri Sep 09, 2005 5:08 pm Post subject: |
|
|
| No error no nothing just nothing it's like...close and nothing |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Fri Sep 09, 2005 5:42 pm Post subject: |
|
|
OK, how about this:
%%ShutDown1 = rundll32.exe, user32.dll LockWorkStation
run cmd.exe /c %%ShutDown1
By the way, what OS are you using?
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Fri Sep 09, 2005 5:43 pm Post subject: |
|
|
Your code do not work and OS is XP SP2
-
This don't work also
must be some limitation somewhere
%W = @WINDIR(S)
%%ShutDown1 = %W\rundll32.exe user32.dll"," LockWorkStation
Shell open, %%ShutDown1
Created icon from desktop it has this line:
%windir%\System32\rundll32.exe user32.dll, LockWorkStation
DEAD END... |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Fri Sep 09, 2005 6:04 pm Post subject: |
|
|
Did you try it with:
run cmd.exe /c %%ShutDown1
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
|