forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Run and shell open at same time
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Thu Sep 08, 2005 4:05 am    Post subject: Run and shell open at same time Reply with quote

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
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Thu Sep 08, 2005 3:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Sep 09, 2005 7:40 am    Post subject: Reply with quote

Filip, you should really use indention when coding, that way you can spot errors like these a lot faster... Smile

Btw. I added the [code:1:] tag to your post, which automatically indents and highlights it... Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Fri Sep 09, 2005 1:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Fri Sep 09, 2005 2:32 pm    Post subject: Reply with quote

I'm confused... What exactly are you trying to do?

Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Fri Sep 09, 2005 3:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Fri Sep 09, 2005 3:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Fri Sep 09, 2005 4:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Fri Sep 09, 2005 4:49 pm    Post subject: Reply with quote

Try putting quotes around the rundll32 command:

%%ShutDown1 = "rundll32.exe, user32.dll LockWorkStation"

Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Fri Sep 09, 2005 4:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Fri Sep 09, 2005 5:02 pm    Post subject: Reply with quote

What do you mean by "exit by itself"?

Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Fri Sep 09, 2005 5:08 pm    Post subject: Reply with quote

No error no nothing just nothing it's like...close and nothing
Back to top
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Fri Sep 09, 2005 5:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Fri Sep 09, 2005 5:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Fri Sep 09, 2005 6:04 pm    Post subject: Reply with quote

Did you try it with:

run cmd.exe /c %%ShutDown1

Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group